Lecture 2 Part 1 Normalization PDF
Lecture 2 Part 1 Normalization PDF
Database Systems
Dr. Jihan A. Rasool
Last Friday’s Hit
• The vital topic of Normalisation
– Data redundancy
– Functional dependencies
– Normal forms
– First, Second, and Third Normal Forms
X→Y
1NF
R
Order Product Customer Address Quantity UnitPrice
Normalisation to 2NF
• Remember 2nd normal form means no partial dependencies on the
key. But we have:
{Product} {UnitPrice}
1NF R2
Order Product Quantity UnitPrice
2NF
R3 R4
Product UnitPrice Order Product Quantity
Now let’s go 3NF…
• R has now been split into 3 relations - R1, R3, and R4… but R1 has a
transitive FD on its key…
2NF
R1 Order Customer Address
3NF
R5 Order Customer R6 Customer Address
Let’s summarize that:
• 1NF:
{Order, Product, Customer, Address, Quantity, UnitPrice}
• 2NF:
{Order, Customer, Address}
{Product, UnitPrice}
{Order, Product, Quantity}
• 3NF:
{Product, UnitPrice}
{Order, Product, Quantity}
{Order, Customer}
{Customer, Address}
So this…
0NF
R
Order Product Customer Address Quantity UnitPrice
has become this…
3NF
Prices Product UnitPrice