10 Normalization
10 Normalization
Software Engineering,
103 Amrita
Compiler Design
Second Normal Form (2NF)
• A relation must be in 1NF and
• No partial dependency should exist in the relation.
• Partial Dependency: If a non-prime attribute can be determined by
the part of the candidate key in a relation, it is known as a partial
dependency.
• if L.H.S is the proper subset of a candidate key and R.H.S is the non-
prime attribute, then it shows a partial dependency.
Partial Dependency &
Prime, Non-Prime attributes
• Partial Dependency: If a non-prime attribute can be determined by
the part of the candidate key in a relation, it is known as a partial
dependency.
• if L.H.S is the proper subset of a candidate key and R.H.S is the non-
prime attribute, then it shows a partial dependency.
• R(ABCD) && FD= AB->C, C->D, B->D && Candidate key=AB
Third Normal Form (3NF)
• A relation must be in second normal form (2NF) And there should be
no transitive functional dependency exists for non-prime attributes in
a relation.
Rollno State City
1 Punjab Chandigarh
2 Haryana Ambala
3 Punjab Chandigarh
4 Haryana Ambala
5 Uttar Pradesh Ghaziabad
Check whether a table in 3rd NF or Not
• In all FDs X->Y
• X is a super key or candidate key And Y is a prime attribute, i.e., Y is a
part of candidate key.
Boyce-Codd Normal Form (BCNF)
• A relation is in 3NF And for every functional dependency, X → Y, L.H.S
of the every functional dependency (X) be the super key of the table.
• R(ABCD) && FD: A->B, B->C, C->D, D->A
Fourth Normal Form
• A relation is in BCNF.
• And, there is no multivalued dependency exists in the relation.
• Multivalued dependency: For a dependency X → Y, if for a single
value of X, multiple values of Y exists, then the relation may have a
multi-valued dependency. It is represented by the double arrow
sign (→→).
Fourth Normal Form
STU_ID COURSE HOBBY
21 Computer Dancing
21 Math Singing
34 Chemistry Dancing
74 Biology Cricket
59 Physics Hockey
Fifth normal form (5NF)
• A relation is in 5NF if it is in 4NF and not contains any join
dependency and joining should be lossless.
• No spurious tuples
• 5NF is also known as Project-join normal form (PJ/NF).