180 likes | 393 Views
Normalization. Normalization Introduction. Developed by E.F Codd Normalization of data is a process of analyzing the given relation schema based on their FDs ( Functional Dependencies ) and primary keys to achieve the desirable properties of Minimizing redundancy
E N D
Normalization Introduction • Developed by E.F Codd • Normalization of data is a process of analyzing the given relation schema based on their FDs (Functional Dependencies) and primary keys to achieve the desirable properties of • Minimizing redundancy • Minimizing the insertion, deletion and update anomalies.
Types of Normalization There are seven types normalization such as • First Normal Form (1NF) • Second Normal Form (2NF) • Third Normal Form (3NF) • Boyce-Codd Normal Form (BCNF), • Fourth Normal Form (4NF), • Fifth Normal Form (5NF) • Domain Key Normal Form (DKNF)
First Normal Form • Elimination of Multivalued attributes • A domain is atomic if elements of the domain are considered to be indivisible units. • A relation schema R is in first normal form (1NF) if the domains of all attributes of R are atomic Example Unnormalized table DNAME DNO DMGRID DLOC Research 5 100 {A,B,C} Administration 4 200 {D} Head 1 400 {E} Normalized table – Staff table in 1NF DNAME DNO DMGRID DLOC Research 5 100 A Research 5 100 B Research 5 100 C Administration 4 200 D Head 1 400 E
Transforming to 1NF Transforming to rows, rather than columns 6
Transforming to 1NF: Example Another example UNF 1NF 7
Repeat First NF (cont.)
Multi-value Problem Staff • Problem • Difficult to manipulate data • Redundancy • UPDATE ANOMALIES
P06 Speech Corpus Insert Staff We can not insert new project if the project has not assigned to any employee yet.
UPDATE ANOMALIES Staff Change ProjName from Voice Ordering to Speech Ordering need to change all in Database
DELETE Problem Staff Delete Employee E002 Somchay Project P03 Medical Image Processing was deleted also
Solution • Remove the repeating group • In case of multi-valued • Create new relation • Columns = Key + multi-valued • Take its determinant with it
PayCheck Employee Repeating group Employee
Multi-Valued Staff