Download presentation
Presentation is loading. Please wait.
1
Normalization
2
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.
3
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)
4
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 {A,B,C} Administration {D} Head {E} Normalized table – Staff table in 1NF Research A Research B Research C Administration D Head E
5
Example -2 Customer ID First Name Surname Telephone Number 123 Robert
Ingram 456 Jane Wright 789 Maria Fernandez Customer ID First Name Surname Tel. No. 1 Tel. No. 2 Tel. No. 3 123 Robert Ingram 456 Jane Wright 789 Maria Fernandez
6
Transforming to 1NF Transforming to rows, rather than columns
Customer ID First Name Surname Telephone Number 123 Robert Ingram 456 Jane Wright 789 Maria Fernandez 6
7
Transforming to 1NF: Example
Another example UNF 1NF 7
8
First NF (cont.) NO Name District PayDate1 Amount1 PayDate2 Amount2
Somchai Khon Kaen 15/04/2004 5,000.00 30/04/2004 E002 Sompong Sarakham 4,500.00 E003 Somchay Ubon 5,200.00 Repeat
9
Problem Multi-value Staff ENO Name Dno DeptName ProjNo ProjName E001
Somchai D01 Physic P01, P02 NMR, Laser E002 Sompong P03 Medical Image processing E003 Somchay D02 Computer Science P04, P05 Voice ordering, Speech Coding E004 SomSiri P04, P06 Voice ordering, Speech Synthesis Problem Difficult to manipulate data Redundancy UPDATE ANOMALIES
10
Insert P06 Speech Corpus Staff ENO Name Dno DeptName ProjNo ProjName
Somchai D01 Physic P01, P02 NMR, Laser E002 Sompong P03 Medical Image processing E003 Somchay D02 Computer Science P04, P05 Voice ordering, Speech Coding E004 SomSiri P04, P06 Voice ordering, Speech Synthesis We can not insert new project if the project has not assigned to any employee yet.
11
UPDATE ANOMALIES Staff ENO Name Dno DeptName ProjNo ProjName E001
Somchai D01 Physic P01, P02 NMR, Laser E002 Sompong P03 Medical Image processing E003 Somchay D02 Computer Science P04, P05 Voice ordering, Speech Coding E004 SomSiri P04, P06 Voice ordering, Speech Synthesis Change ProjName from Voice Ordering to Speech Ordering need to change all in Database
12
DELETE Problem Staff ENO Name Dno DeptName ProjNo ProjName E001
Somchai D01 Physic P01, P02 NMR, Laser E002 Sompong P03 Medical Image processing E003 Somchay D02 Computer Science P04, P05 Voice ordering, Speech Coding E004 SomSiri P04, P06 Voice ordering, Speech Synthesis Delete Employee E002 Somchay Project P03 Medical Image Processing was deleted also
13
Solution Remove the repeating group In case of multi-valued
Create new relation Columns = Key + multi-valued Take its determinant with it
14
Repeating group Employee ENO Name District PayDate1 Amount1 PayDate2
Somchai Khon Kaen 15/04/2004 5,000.00 30/04/2004 E002 Sompong Sarakham 4,500.00 E003 Somchay Ubon 5,200.00 Employee PayCheck ENO PayDate Amount E001 15/04/2004 5,000.00 30/04/2004 E002 4,500.00 E003 5,200.00 ENO Name District E001 Somchai Khon Kaen E002 Sompong Sarakham E003 Somchay Ubon
15
Multi-Valued Staff ENO Name Dno DeptName ProjNo ProjName E001 Somchai
Physic P01, P02 NMR, Laser E002 Sompong P03 Medical Image processing E003 Somchay D02 Computer Science P04, P05 Voice ordering, Speech Coding E004 SomSiri P04, P06 Voice ordering, Speech Synthesis
16
Multi-Valued ENO Name Dno DeptName ProjNo ProjName P05 P04 P06 E001
Somchai D01 Physic P01 NMR P02 Laser E002 Sompong P03 Medical Image processing E003 Somchay D02 Computer Science P05 Voice ordering P04 Speech Coding E004 SomSiri P06 Speech Synthesis Manipulate easy Update Deptname easy But insert still has problem
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.