3. Normalization
&
Why
Normalization?
Decomposition of fat relations into smaller meaningful relations
Higher the normal forms higher the number of relations and
higher the quality of data
To minimize redundancy
To minimize insertion, deletion and updation anomalies
7/16/2016 3
4. Ethics of
Normalization
Lossless Join ( Non Additive Join Property)
Assures no spurious table generation
Assures no loss of records
R = R1 R2
R = R1 (r) Join R2 (r)
Dependency Preservation Property
FD’s in Original scheme should exist in decomposed relation as
well
7/16/2016 4
5. FIRST NORMAL FORM
Attribute values must be atomic or single or indivisible
A relational schema R is in first normal form if the domains of all attributes of R are atomic
R:
R1 R2
7/16/2016 5
EID ENAME ELOC
EID ENAME EID ELOC
6. SECOND NORMAL FORM
A relational schema R is in second normal form if Relation R is in
1 NF
All non prime attributes in the table must be fully functionally dependent on the primary
key.
R:
R1 R2
R3
7/16/2016 6
EID ENAME ELOC PID PHRS
EID ENAME EID ELOC
EID PID PHRS
7. FULL & PARTIAL FUNCTIONAL DEPENDENCIES
An FD X->Y is PFD if,
Removal of an attribute from X still holds the dependency
Eg : Eid,Pid -> Ename (PFD)
Hence Decompose !
An FD X->Y is FFD if,
Removal of an attribute from X breaks the dependency
All attributes has major contribution
Eid,Pid->Phrs (FFD)
7/16/2016 7
8. THIRD NORMAL FORM
A relational schema R is in third normal form if Relation R ,
is in 2 NF
No non prime attribute of R is transitively dependent on primary key of R
R :
Eid ->Ename, Dob, Did, Dname
Did->Dname
7/16/2016 8
EID ENAME DOB DID DNAME
9. THIRD NORMAL FORM
Transitive dependency
Eid->Did ,Did->Dname and hence Eid->Ename exists !
Transitive Dependency exists ! Hence Decompose !
Decomposed tables,
R1 R2
7/16/2016 9
EID ENAME DOB DID DID DNAME
10. BCNF NORMAL FORM
Very stricter version of 3 NF
A relational schema R is in Boyce codd normal form if Relation R ,
is in 3 NF
For every non trivial FD X->A , X must be a super key !
R :
Eid ->Ename, Dob, Did
Did->Dname
Eid and Did { Super Keys }
7/16/2016 10
EID ENAME DOB DID DNAME