Database Normalization
Database Normalization
O F RE L AT IO N A L DATA B A S E S
MIT 202 – Adv a n c e d D ata b a s e M a n a g e m e n t Sys te m
Mr. Jos e p h S. Joa q u in
O b je ctive s
At the end of this top ic , stu d e n ts will be able to:
• D e te rm in e the ste p s on how to con v e rt use r ’s vie w
of info rm a tio n to a rela tio n a l data b a s e ; and
• C re a te a rela tio n a l data b a s e usin g the prin c ip le s of
norm a liz a tio n .
G u id e Qu estion s
• H o w to cre a te a rela tio n a l data b a s e fro m use r ’s
vie w of info rm a tio n ?
W h a t is Norm a liza tio n ?
N o rm a liz a tio n is the pro c e s s of eva lu a tin g and
corre c tin g tab le stru c tu re s to m in im iz e data
red u n d a n c ie s and to elim in a te ano m a lie s in add in g ,
upd a tin g , and dele tio n of rec o rd s .
No rm al Fo rm s
• 1N F (Firs t N o rm a l Form )
• 2N F (S e c o n d N o rm a l Fo rm )
• 3N F (Th ird N o rm a l Form )
• B C N F (B o y c e -C o d d N o rm a l Form )
Le ve ls of No rm al Fo rm s
2N F is bette r tha n 1N F and 3N F is m u c h bette r tha n
1N F and 2N F.
Thre e -s te p pro c e d u re :
• Ste p 1 – Elim in a te R e p e a tin g Gro u p s
• Ste p 2 – Ide n tify the Prim a ry K e y s
• Ste p 3 – Ide n tify All D e p e n d e n c ie s
First No rm al Fo rm (Continued)
E xa m p le
First No rm al Fo rm (Continued)
E xa m p le
Fun c tio n a l D e p e n d e n c y
P a rtia l D e p e n d e n c y
PR O J _ N U M PR O J _ N A M E
EM P _ N U M EM P _ N A M E , JO B _ C L A S S , CH G _ H O U R
First No rm al Fo rm (Continued)
Tra n s itiv e D e p e n d e n c y
JO B _ C LA S S C H G _H O U R
First No rm al Fo rm (Continued)
Ste p s to con v e rt 1N F to 2N F :
• Ste p 1. Ide n tify All K e y C o m p o n e n ts
• Ste p 2. Ide n tify the D ep e n d e n t Attrib u te s
Secon d No rm a l Form (Continued)
E xa m p le :
• PRO J_N U M
• EMP_N U M
• PRO J_N U M , EMP _N U M
E xa m p le
• P R O J E C T (P R O J _ N U M , P R O J _ N A M E )
• E M P L O Y E E (E M P _ N U M , E M P _ N A M E , JO B _ C L A S S ,
CHG _H O U R S )
• AS S IG N (P R O J _ N U M , E M P _ N U M , A S S IG N _ H O U R S )
Secon d No rm a l Form (Continued)
2N F D e p e n d e n c y Dia g ra m
Secon d No rm a l Form (Continued)
Ste p s to con v e rt 2N F to 3N F :
• Ste p 1. Ide n tify E ac h N e w D e te rm in a n t;
• Ste p 2. Ide n tify the D ep e n d e n t Attrib u te s ; and
• Ste p 3. R e m o v e the dep e n d e n t attrib u te s from
tran s itiv e dep e n d e n c ie s .
Th ird No rm al Form (Continued)
E xa m p le
• JO B _ C L A S S → C H G _ H O U R
Th ird No rm al Form (Continued)
E xa m p le
• JO B (JO B _ C L A S S , C H G _ H O U R )
Th ird No rm al Form (Continued)
• P R O J E C T (P R O J _ N U M , P R O J _ N A M E )
• E M P L O Y E E (E M P _ N U M , E M P _ N A M E ,
JO B _ C L A S S )
• A S S IG N (P R O J _ N U M , E M P _ N U M ,
A S S IG N _ H O U R S )
• JO B (JO B _ C L A S S , C H G _ H O U R S )
Th ird No rm al Form (Continued)
3N F D e p e n d e n c y Dia g ra m
Th ird No rm al Form (Continued)