DB Lecture 7. Data Normalization
DB Lecture 7. Data Normalization
Design 1
LECTURE 6: DATA
NORMALIZATION
DONE BY:
ENG. GAWHAR GAMAL
Transforming EER Diagrams
into Relations (cont.)
(b)
EMPLOYEE
relation with
recursive
foreign key
Figure 4-18 Mapping a unary M:N relationship
(a) Bill-of-materials
relationships (unary M:N)
Insertion: can’t enter a new employee without having the employee take a class
(or at least empty fields of class information).
Deletion: if we remove employee 140, we lose information about the existence of
a Tax Acc class.
Modification: giving a salary increase to employee 100 forces us to update
multiple records.
It is important that a database reach third normal form. Boyce-Codd, fourth, and fifth are of
theoretical interest, but not generally considered vital for qualifying as a set of well-
structured relations.
Functional Dependencies and Keys
No multivalued attributes.
Every attribute value is atomic.
st
Fig. 4-25 is not in 1 Normal Form (multivalued attributes) → it
is not a relation.
Fig. 4-26 is in 1st Normal form.
All relations are in 1st Normal Form.
st
Table with multivalued attributes, not in 1 normal form
➔
OrderID OrderDate, CustomerID, CustomerName, CustomerAddress
➔
CustomerID CustomerName, CustomerAddress
➔
ProductID ProductDescription, ProductFinish, ProductStandardPrice
➔
OrderID, ProductID OrderQuantity
nd
Therefore, NOT in 2 Normal Form
Figure 4-28 Removing partial dependencies
Getting it into
Second Normal
Form