Database
Database
Spring 2016
Lab Assignment 5 - 75 points
C1 C2 C3 C4 C5
The dependency diagram below indicates that a patient can receive many
prescriptions for one or more medicines over time.
2. Based on the dependency diagram above, create a database whose tables are in at
least 3NF, showing the dependency diagram for each table. (10 Points)
MedName Date
PatientID PatientName
MedName ShelfLife
Attribute Name Sample Value Sample Value Sample Value Sample Value Sample Value
INV_NUM 211347 211347 211347 211348 211349
PROD_NUM AA-E3422QW QD-300932X RU-995748G AA-E3422QW GH-778345P
SALE_DATE 15-Jan-2010 15-Jan-2010 15-Jan-2010 15-Jan-2010 16-Jan-2010
PROD_LABEL Rotary sander 0.25-in. drill bit Band saw Rotary sander Power drill
VEND_CODE 211 211 309 211 157
VEND_NAME NeverFail, Inc. NeverFail, Inc. BeGood, Inc. NeverFail, Inc. ToughGo, Inc.
QUANT_SOLD 1 8 1 2 1
PROD_PRICE $49.95 $3.45 $39.99 $49.95 $87.75
Prepared by Cindy Waters
Page 2
DBA110 Database Concepts
Spring 2016
Lab Assignment 5 - 75 points
3. Write the relational schema, draw its dependency diagram 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.)
(10 Points)
4. Remove all partial dependencies, draw the new dependency diagrams, and
identify the normal forms for each table structure you created. (10 Points)
5. Remove all transitive dependencies, and draw the new dependency diagrams. Also
identify the normal forms for each table structure you created. (10 Points)
Prepared by Cindy Waters
Page 3
DBA110 Database Concepts
Spring 2016
Lab Assignment 5 - 75 points
6. To keep track of employees and departments, the Somewhere Company uses the
table structure shown below.
EmpID LastName FirstName DeptID Email DeptName DeptPhone
100 Johnson Sam 325 [email protected] Accounting 834-1100
200 Abernathy Jane 350 [email protected] Finance 834-1200
300 Smathers Henry 350 [email protected] Finance 834-1200
400 Jackson Ronald 300 [email protected] Production 834-1400
500 Caldera Cindy 400 [email protected] Legal 834-1000
a. Draw its dependency diagram, and identify all dependencies. You can assume
that the table does not contain repeating groups and the table uses a single
primary key. (10 Points)
Employee
Department
PK EMP ID
PK DeptID
LastName
FirstName DeptName
Email FK1 EMP ID
Department Details
PK,FK1 DeptID
DeptPhone