1. 3N Normalized Databases
MINISTÈRE DE L’ENSEIGNEMENT SUPÉRIEUR DE LA RECHERCHE SCIENTIFIQUE
UNIVERSITÉ TUNIS EL MANAR
بتونس للمهندسين الوطنية المدرسة
ÉCOLE NATIONALE D’INGÉNIEURS DE TUNIS
By:
Rami MAHJOUBA
Achraf CHEBIL
2. • Overview
Introduction
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Conclusion
3. • Introduction
Organizing relations and attributes
To improve data integrity
Eliminate data redundancy
Inappropriate functional dependencies
What is Normalization?
4. • Introduction
EDGARD F. CODD.
Invented the relational model
Introduced normalization
Proposed 3 initial normal forms and the Boyce-Codd form
History overview
7. • First Normal Form (1NF)
Data cannot be broken down further(atomic)
Columns have no repeating/similar data
Each row is unique
Each field has a unique name
Rules For 1NF
8. • First Normal Form (1NF)
Original Invoice Table
Invoice Number Date Amount Customer ID Customer Name Item
125 09/15/2016 1000 17 Harry Potter Wand, Cloak
126 09/16/2016 150 21 Percy Jackson Bolt
127 09/16/2016 380 12 Katniss Everdeen Bow, Arrow
128 09/16/2016 850 17 Harry Potter Broom
Break Down
9. • First Normal Form (1NF)
Revised Invoice Table
Invoice Number Date Amount Customer ID Customer First Name Customer Last Name Item
125 09/15/2016 1000 17 Harry Potter Wand,
Cloak
126 09/16/2016 150 21 Percy Jackson Bolt
127 09/16/2016 380 12 Katniss Everdeen Bow,
Arrow
128 09/16/2016 850 17 Harry Potter Broom
Atomic
10. • First Normal Form (1NF)
Revised Invoice Table
Invoice
Number
Date Amount Customer ID Customer First Name Customer Last Name Item
125 09/15/2016 1000 17 Harry Potter Wand
125 09/15/2016 1000 17 Harry Potter Cloak
126 09/16/2016 150 21 Percy Jackson Bolt
127 09/16/2016 380 12 Katniss Everdeen Bow
127 09/16/2016 380 12 Katniss Everdeen Arrow
128 09/16/2016 850 17 Harry Potter Broom
No
Repeating
Data
Unique
Rows
11. • Second Normal Form (2NF)
Should be in 1NF
Non-key attributes are functional dependent on primary key
Rules For 2NF
12. • Second Normal Form (2NF)
1NF invoice table
Invoice
Number
Date Amount Customer ID Customer First Name Customer Last Name Item
125 09/15/2016 1000 17 Harry Potter Wand
125 09/15/2016 1000 17 Harry Potter Cloak
126 09/16/2016 150 21 Percy Jackson Bolt
127 09/16/2016 380 12 Katniss Everdeen Bow
127 09/16/2016 380 12 Katniss Everdeen Arrow
128 09/16/2016 850 17 Harry Potter Broom
Non-dependant
13. • Second Normal Form (2NF)
2NF invoice table + Invoice table
Invoice
Number
Date Amount Customer
ID
Customer
First Name
Customer Last Name
125 09/15/2016 1000 17 Harry Potter
126 09/16/2016 150 21 Percy Jackson
127 09/16/2016 380 12 Katniss Everdeen
128 09/16/2016 850 17 Harry Potter
Invoice
Number
Item
125 Wand
125 Cloak
126 Bolt
127 Bow
127 Arrow
128 Broom
Foreign Key
14. • Third Normal Form (3NF)
Should be in 2NF
No Transitive dependencies
Rules For 3NF
15. • Third Normal Form (3NF)
2NF invoice table
Invoice
Number
Date Amount Customer
ID
Customer
First Name
Customer Last Name
125 09/15/2016 1000 17 Harry Potter
126 09/16/2016 150 21 Percy Jackson
127 09/16/2016 380 12 Katniss Everdeen
128 09/16/2016 850 17 Harry Potter
Transitive dependency
X Y
Y Z
X Z
16. • Third Normal Form (3NF)
3NF invoice table + Customers table
Invoice
Number
Date Amount Customer
ID
125 09/15/2016 1000 17
126 09/16/2016 150 21
127 09/16/2016 380 12
128 09/16/2016 850 17
Customer
ID
Customer First
Name
Customer last
Name
17 Harry Potter
21 Percy Jackson
12 Katniss Everdeen
17 Harry Potter
Foreign Key
17. • Conclusion
We have seen how Database Normalization can:
Decrease redundancy
Increase efficiency
Reduce anomalies
By implementing three of all the different levels of normalization called
Normal Forms. The first three NF’s are usually sufficient for most small
to medium size applications.