DBS211_Lab10_Normalization2
DBS211_Lab10_Normalization2
Lab 10 – Normalization 2
(2NF, 3NF)
Objective:
Students will learn:
To continue the normalization of user views from 1NF to 2NF and 3NF
How to identify and remove partial dependencies
How to identify and remove transitive dependencies
Submission:
Save your lab file as a PDF file. You need to submit a single PDF
named as DBS211_L10_Group_Number file for this lab.
Your name and student ID MUST be in the PDF file or you will
receive a mark of zero.
Definitions:
Definition: A relation is in 1NF if it contains no multi-valued dependencies (also
known as repeating groups).
Definition: A relation is in 2NF it is in 1NF and it contains no Partial Dependencies.
Definition: A Partial Dependency occurs when a non-key attribute(s) is dependent
on (or is determined by) a part of a composite primary key.
Definition: A relation is in 3NF it is in 2NF and it contains no Transitive
Dependencies.
Definition: A Transitive Dependency occurs when a non-key attribute (s) is
dependent on (or is determined by) another non-key attribute.
Instructions:
Part A (Second Normal Form (2NF))
DBS211
Note: A relation that has only a simple primary key cannot have any partial
dependencies!
Premiere Corporation
Customer Orders
Customer Name Order Order Date Sales Rep Rep Last
Number Number Name
124 Sally Adams 12489 2016-09-02 03 Jones
12500 2016-09-05
256 Ann Samuels 12495 2016-09-04 06 Smith
311 Don Charles 12491 2016-09-02 12 Diaz
315 Tom Daniels 12494 2016-09-04 06 Smith
522 Mary Nelson 12498 2016-09-05 12 Diaz
12504 2016-09-05
Step 1:
Create the UNF relation by creating a relation composed of all the attributes found
in the User View. Don’t forget to underline the primary key and place brackets
around any multi-valued dependencies (also known as repeating groups) you may
find.
UNF:
_____________________________________________________________________________________
_______
Step 2:
Create the 1NF relations by resolving the multi-valued dependencies (also known as
repeating groups):
1NF
Now you are ready to create the 2NF relations by resolving the partial
dependencies from the 1NF relations.
Note: if you did not get a similar solution, please talk to your instructor about it
now! It is very important to get the correct UNF and 1NF relations.
DBS211
Step 3:
The process for taking a relation from 1NF to 2NF involves resolving the partial
dependencies. We see that from our definition of 2NF (page 1) a partial Dependency
is when a non-key attribute is determined by a part of the primary key. We also
read in the note (page 1) that we cannot have partial dependencies when there is a
one-part Primary Key).
Now examine the Cust_Order relation. Does it have a composite primary key ( a
key made up of more than 1 field) ? ____________
Are any of the non-key attributes determined by ONE of the key attributes?
_______________________
[CustNo ,
[OrderNo ,
[CustNo, OrderNo ,
Place all non-key attributes on the appropriate table (hint: choose the table with the
least parts.
2NF:
CUSTOMER [ CustNo,
ORDER [ OrderNo
CUSTORDER [ CustNo, OrderNo,
We now have a set of 2NF relations from our User View. Your 2NF solution should
look something like this:
2NF:
Customer [ CustNo, CustName, RepNo, RepName ]
CustOrder [ CustNo, OrderNo ]
Order [ OrderNo, Orderdate ]
If you did not correctly identify the order relation, please ask your instructor about
this process now!
Note: if a relation contains less than 2 non-key attributes, there cannot be any
transitive dependencies. Therefore the CustOrder and Order relations cannot
contain any transitive dependencies! Simply copy those relations to the 3NF
solution.
REP [ ]
3. The last step in resolving the transitive dependency is to maintain the link (or
relationship) between the relation that contained the transitive dependency
(Customer) and the new relation (Rep). We do this by placing a foreign key
to the new relation (Rep) into the relation that contained the transitive
dependency (Customer). The foreign key will be the primary key of the new
relation. Don’t forget to identify it with (FK)
3NF:
Lab 9 Submission:
For the following User View, determine the 1, 2 and 3NF and hand in this
page to your instructor. The UNF relation has been provided.
Premiere Corporation
Order Detail Report
Order Order Date Cust Cust Last Part Part Qnty Quoted
Numb Number Name Number Desc Ordered Price
er
12489 2016-09-02 124 Adams AX12 Iron 11 14.95
124
12491 2016-09-02 311 Charles BT04 GasGrill 3 440.00
311 BZ66 Washer 1 399.99
CX11 MiniBlende 1 11.98
r
12494 2016-09-04 315 Daniels CB03 Bike 4 279.96
12495 2016-09-04 256 Samuels CX11 MiniBlende 2 23.96
r
12498 2016-09-05 522 Nelson AZ52 Dartboard 2 12.96
BA74 Basketbal 4 24.96
12500 2016-09-05 124 Adams BT04 GasGrill 1 149.99
12504 2016-09-05 522 Nelson CZ81 Treadmill 2 325.98
UNF:
Order [ OrderNo, Orderdate, CustNo, CustLname, (PartNo, PartDesc, QtyOrd, Price)]
1NF:
2NF:
3NF: