Database Management System 17: Normal Forms
Database Management System 17: Normal Forms
Database Management System 17: Normal Forms
Chittaranjan Pradhan
1NF(First Normal
System 17 Form)
Partial FD
Transitive FD
3NF(Third Normal
Form)
BCNF (Boyce-Codd
Normal Form)
Chittaranjan Pradhan
School of Computer Engineering,
KIIT University
17.1
Normal Forms
Normal Forms
Chittaranjan Pradhan
Normal Forms
1NF(First Normal
Form)
Partial FD
2NF(Second Normal
Normal Forms Form)
Transitive FD
• Normal forms provide a stepwise progression towards the
3NF(Third Normal
construction of normalized relation schemas, which are Form)
17.2
Normal Forms
1NF(First Normal Form)
Chittaranjan Pradhan
Normal Forms
1NF(First Normal Form) 1NF(First Normal
Form)
A relation is in 1NF iff the values in the relation are atomic and Partial FD
Transitive FD
Module Dept Lecturer Text 3NF(Third Normal
M1 D1 L1 T1 ,T2 Form)
17.3
Normal Forms
1NF(First Normal Form)...
Chittaranjan Pradhan
Module Dept Lecturer Text
M1 D1 L1 T1
Normal Forms
M1 D1 L1 T2
1NF(First Normal
M2 D1 L1 T1 Form)
Course1 M2 D1 L1 T3 Partial FD
M3 D1 L2 T4 2NF(Second Normal
Form)
M4 D2 L3 T1
Transitive FD
M4 D2 L3 T5
3NF(Third Normal
M5 D2 L4 T6 Form)
BCNF (Boyce-Codd
Module Dept Lecturer Text1 Text2 Normal Form)
M1 D1 L1 T1 T2
M2 D1 L1 T1 T3
Course2
M3 D1 L2 T4
M4 D2 L3 T1 T5
M5 D2 L4 T6
Normal Forms
1NF(First Normal
Form)
Partial FD
Partial FD 2NF(Second Normal
Form)
A FD A → B is a partial FD, if some attribute of A can be Transitive FD
removed and the FD still holds. That means there is some 3NF(Third Normal
proper subset of A, C ⊂ A, such that C → B Form)
BCNF (Boyce-Codd
Normal Form)
17.5
Normal Forms
2NF(Second Normal Form)
Chittaranjan Pradhan
2NF(Second Normal Form)
A relation is in 2NF iff the following two conditions are met Normal Forms
• It is in 1NF Partial FD
2NF(Second Normal
• No non-key attribute is partially dependent on any key Form)
Transitive FD
Normal Forms
1NF(First Normal
Form)
M1 D1 L1 T1 2NF(Second Normal
Form)
M1 D1 L1 T2
Transitive FD
M2 D1 L1 T1
3NF(Third Normal
Course M2 D1 L1 T3 Form)
M3 D1 L2 T4 BCNF (Boyce-Codd
Normal Form)
M4 D2 L3 T1
M4 D2 L3 T5
M5 D2 L4 T6
17.7
Normal Forms
2NF(Second Normal Form)...
Chittaranjan Pradhan
Normal Forms
3NF(Third Normal
F1 ={Module→{Dept, Lecturer}, Lecturer→Dept} Form)
BCNF (Boyce-Codd
Module Text Normal Form)
M1 T1
M1 T2
M2 T1
Course2 M2 T3
M3 T4
M4 T1
M4 T5
M5 T6
17.8
Normal Forms
2NF(Second Normal Form)...
Chittaranjan Pradhan
Normal Forms
1NF(First Normal
Form)
Corollary: If the primary key has a single attribute, then the Partial FD
relation is in 2NF 2NF(Second Normal
Form)
Transitive FD
Anomalies in 2NF Relations:
3NF(Third Normal
• Insertion anomalies Form)
BCNF (Boyce-Codd
• Updation anomalies Normal Form)
• Deletion anomalies
Q: R=(A, B, C, D, E), & F={A → {B, C, D, E}, {A, B} → {C, D, E},
C → E, D → E}
17.9
Normal Forms
Transitive FD
Chittaranjan Pradhan
Normal Forms
1NF(First Normal
Form)
Partial FD
2NF(Second Normal
Form)
Transitive FD Transitive FD
3NF(Third Normal
A FD A → C is a transitive FD, if there are some set of Form)
17.10
Normal Forms
3NF(Third Normal Form)
Chittaranjan Pradhan
A relation is in 3NF iff the following two conditions are satisfied 1NF(First Normal
Form)
simultaneously:
Partial FD
• It is in 2NF 2NF(Second Normal
Form)
• No non-key attribute is transitively dependent on the key Transitive FD
The process of decomposing the non-3NF relation into 3NF 3NF(Third Normal
Form)
relations is similar to the process of decomposing the non-2NF BCNF (Boyce-Codd
relation to 2NF relations Normal Form)
Normal Forms
1NF(First Normal
Module Lecturer Form)
M1 L1
M2 L1 Partial FD
Course1 M3 L2 2NF(Second Normal
M4 L3 Form)
M5 L4
Transitive FD
3NF(Third Normal
F1 ={Module→Lecturer} Form)
BCNF (Boyce-Codd
Lecturer Dept Normal Form)
L1 D1
Course2 L2 D1
L3 D2
L4 D2
F2 ={Lecturer→Dept}
17.12
Normal Forms
3NF(Third Normal Form)...
Chittaranjan Pradhan
The 3NF helped us to get rid of the anomalies caused by
dependencies of a non-key attribute on another non-key
Normal Forms
attribute
1NF(First Normal
Form)
when the relations have two overlapping candidate keys or 2NF(Second Normal
Form)
when non-key attribute functionally determines a key attribute. Transitive FD
• It is in 3NF Partial FD
2NF(Second Normal
• If for every non-trivial functional dependency, the Form)
3NF(Third Normal
The process of decomposing the non-BCNF relation into BCNF Form)
relations is a simple process. For each non-trivial FD where the BCNF (Boyce-Codd
Normal Form)
determinant is not the key, construct new relations
Normal Forms
1NF(First Normal
Form)
This relation is not present in BCNF as in FD Time → Course; Partial FD
the determinant {Time} is not a key 2NF(Second Normal
Form)
Transitive FD
After the conversion of this relation to BCNF, create a new
3NF(Third Normal
relation R1 =(Time, Course) with set of FDs F1 ={Time → Form)
17.15
Normal Forms
BCNF (Boyce-Codd Normal Form)...
Chittaranjan Pradhan
Corollary: If a relation has only one candidate key, then
3NF and BCNF are same. That means if a relation is in 3NF
Normal Forms
having only one candidate key, then it is also present in
1NF(First Normal
BCNF Form)
Partial FD
lossless, but may not preserve all the functional 3NF(Third Normal
Form)
dependencies
BCNF (Boyce-Codd
Normal Form)