Uploaded by piethlogi45

SCOA031 - Supp exam

advertisement
UNIVERSITY OF LIMPOPO
FACULTY OF SCIENCE AND AGRICULTURE
SCHOOL OF MATHEMATICAL AND COMPUTER SCIENCES
DEPARTMENT OF COMPUTER SCIENCE
DEGREE AND DIPLOMA SUPPLEMENTARY/AEGROTAT EXAMINATION
MAY/JUNE: 2018
MODULE:
PAPER:
P
MARKS:
60
SCOA031
(INTRODUCTION TO DATABASE SYSTEMS)
TIME:
2 HOURS
INTERNAL EXAMINER:
MR PS RAMALEPE
SECOND EXAMINER:
MS DZ MASUKU
EXTERNAL EXAMINER: PROF DB JORDAAN (NWU-Vaal)
THIS PAPER CONSISTS OF …5…PAGES INCLUDING COVER PAGE
INSTRUCTIONS:
1. Answer all the questions
2. Write neatly and legibly
SCOA031 SUPPLEMENTARY/AEGROTAT EXAMINATION
2018
Question 1 [20]
1.1.
Define the following terms as applied in databases:
[05]
1.1.1 Metadata
1.1.2 Data redundancy
1.1.3 Logical independence
1.1.4 Entity integrity
1.1.5 Referential integrity
1.2.
What is a DBMS?
[01]
1.3. Briefly describe any three basic characteristics of a NoSQL database.
[06]
1.4. What is an entity supertype?
[01]
1.5. What is the difference between partial completeness and total completeness?
[02]
1.6. What primary key characteristics are considered desirable? Give only 5 characteristics
and explain why each characteristic is considered desirable.
[05]
Question 2 [20]
2.1 What components should an implementation-ready data model contain? [03]
2.2 Create a Crow’s Foot ERD to include the following business rules for the ProdCo
company:
[05]
 Each sales representative writes many invoices.
 Each invoice is written by one sales representative.
 Each sales representative is assigned to one department.
 Each department has many sales representatives.
 Each customer can generate many invoices.
 Each invoice is generated by one customer.
2.3 What is the difference between an object and a class in the object oriented data model
(OODM)?
[02]
2.4 Given the following business scenario, create a Crow’s Foot ERD using a specialization
hierarchy if appropriate. Indicate at least three attributes and identify the primary and
foreign keys.
[10]
Granite Sales Company keeps information on employees and the departments that they
work in. For each department, the department name, internal mail box number, and
office phone extension are kept. A department can have many assigned employees,
and each employee is assigned to only one department. Employees can be salaried
employees, hourly employees, or contract employees. All employees are assigned an
employee number. This is kept along with the employee’s name and address. For
2|Page
SCOA031 SUPPLEMENTARY/AEGROTAT EXAMINATION
2018
hourly employees, hourly wage and target weekly work hours are stored (e.g. the
company may target 40 hours/week for some, 32 hours/week for others, and 20
hours/week for others).
Some salaried employees are salespeople that can earn a
commission in addition to their basic salary. For all salaried employees, the yearly
salary amount is recorded in the system. For salespeople, their commission percentage
on sales and commission percentage on profit are stored in the system. For example,
John is a salesperson with a basic salary of $50,000 per year plus 2-percent
commission on the sales price for all sales he makes plus another 5 percent of the profit
on each of those sales. For contract employees, the beginning date and end dates of
their contract are stored along with the billing rate for their hours.
Question 3 [20]
3.1
Using the INVOICE table structure shown in Table 1 do the following:
Table 1 INVOICE Records
Attribute
Name
INV_NUM
PROD_NUM
SALE_DATE
PROD_LABEL
VEND_CODE
VEND_NAME
QUANT_SOLD
PROD_PRICE
Sample
Value
211347
AAE3422QW
15-Jan-2016
Rotary
sander
211
NeverFail,
Inc.
1
$49.95
Sample
Value
211347
QD-300932X
Sample
Value
211347
RU-995748G
15-Jan-2016
0.25-in. drill
bit
211
NeverFail,
Inc.
8
$3.45
15-Jan-2016
Band saw
309
BeGood, Inc.
1
$39.99
Sample
Value
211348
AAE3422QW
15-Jan-2016
Rotary
sander
211
NeverFail,
Inc.
2
$49.95
Sample
Value
211349
GH-778345P
16-Jan-2016
Power drill
157
ToughGo,
Inc.
1
$87.75
3.1.1 Draw its dependency diagram that is 1NF and identify all dependencies,
including all partial and transitive dependencies. You can assume that the table
does not contain repeating groups and that any invoice number may reference
more than one product. (Hint: This table uses a composite primary key.) [03]
3.1.2 From your answer in 3.1.1, draw new dependency diagrams. Identify the normal
forms for each table structure you created.
[03]
3.1.3 From your answer in 3.1.2, draw new dependency diagrams. Identify the normal
forms for each table structure you created.
[02]
3|Page
SCOA031 SUPPLEMENTARY/AEGROTAT EXAMINATION
2018
3.2 Use the database shown in Figure 2 to solve problems 3.2.1 – 3.2.2. Note that the
database is composed of four tables that reflect these relationships:
 An EMPLOYEE has only one JOB_CODE, but a JOB_CODE can be held by many
EMPLOYEEs.
 An EMPLOYEE can participate in many PLANs, and any PLAN can be assigned to
many EMPLOYEEs.
Note also that the M:N relationship has been broken down into two 1:M relationships for
which the BENEFIT table serves as the composite or bridge entity.
FIGURE 2
3.2.1 For each table in the database, identify the primary key and the foreign key(s). If a table
does not have a foreign key, write None
[04]
NB redraw the table in your answer book.
TABLE
EMPLOYEE
BENEFIT
JOB
PLAN
PRIMARY KEY
FOREIGN KEY(S)
3.2.2 Do the tables exhibit entity integrity? Answer yes or no and then explain your answer.
[04]
NB redraw the table in your answer book.
4|Page
SCOA031 SUPPLEMENTARY/AEGROTAT EXAMINATION
TABLE
EMPLOYEE
BENEFIT
JOB
PLAN
3.3
ENTITY INTEGRITY
2018
EXPLANATION
Suppose that a PRODUCT table contains two attributes, PROD_CODE and
VEND_CODE. These two attributes have values of ABC, 125, DEF, 124, GHI, 124, and
JKL, 123, respectively. The VENDOR table contains a single attribute, VEND_CODE,
with values 123, 124, 125, and 126, respectively. (The VEND_CODE attribute in the
PRODUCT table is a foreign key to the VEND_CODE in the VENDOR table.) Given this
information, what would be the query output for:
(Hint: Because the common attribute is V_CODE, the output must only show the V_CODE
values generated by each query.)
3.3.1
3.3.2
3.3.3
3.3.4
A UNION query based on these two tables?
A UNION ALL query based on these two tables?
An INTERSECT query based on these two tables?
A MINUS query based on these two tables?
[01]
[01]
[01]
[01]
________________________________________________________________________________
5|Page
Download