2.3 Normalization
2.3 Normalization
By
Mr. Parag R. Sali
Lecturer
Department of Computer Technology
SNJB’s Shri. Hiralal Hastimal ( Jain Brothers)
Polytechnic, Chandwad
Program Name: Computer Engineering Group
Program Code : CO/CM/CW
Semester : Third
Course Title : Database Management System
Course Code : 22319
Normalization
NORMALIZATION
Normalization concept
Need of normalization
Types of normalization
1NF
2NF
3NF
BCNF
NORMALIZATION
Normalization is the process of organizing the data in
the database.
Normalization is used to minimize the redundancy
from a relation or set of relations.
It is also used to eliminate the undesirable
characteristics like Insertion, Update and Deletion
Anomalies.
Normalization divides the larger table into the smaller
table and links them using relationship.
The normal form is used to reduce redundancy from the
database table.
NEED OF NORMALIZATION
There are three types of anomalies that occur when the database is
not normalized.
Insert Anomalies
Delete Anomalies
Update Anomalies
Update anomaly: In the above table we have two rows for employee Nick
as he belongs to two departments of the company. If we want to update the
address of Nick then we have to update the same in two rows or the data
will become inconsistent. If somehow, the correct address gets updated in
one department but not in other then as per the database, Nick would be
having two different addresses, which is not correct and would lead to
inconsistent data.
Example: To understand Anomalies
Student Table
14 John 7272826385, UP
9064738238
20 Harry 8574783832 Bihar
12 Sam 7390372389, Punjab
8589830302
Relation/Table Emp is not in 1NF because of multi-valued attribute EMP_PHONE.
The decomposition of the EMPLOYEE table into 1NF has been shown below:
14 John 7272826385 UP
14 John 9064738238 UP
20 Harry 8574783832 Bihar
12 Sam 7390372389 Punjab
12 Sam 8589830302 Punjab
Student Table:
1 John 7272826385 UP
2 Harry 8574783832, Bihar
9876543223,
9823456789
3 Sam 7390372389, Punjab
8589830302
Normalized table into 1NF
1 John 7272826385 UP
2 Harry 8574783832 Bihar
2 Harry 9876543223 Bihar
25 Chemistry 30
25 Biology 30
47 English 35
83 Math 38
83 Computer 38
STAFF Table:
STAFF_SUBJECT Table:
Foreign key
Primary Key
25 30 25 Chemistry
47 35 25 Biology
83 38 47 English
83 Math
83 Computer
Student table
Emp_details Table:
Emp_zip Table:
201010 UP Noida
02228 US Boston
60007 Noida Chicago
06389 UK Norwich
462007 MP Bhopal
Summary
Normal Form Description
2NF A relation will be in 2NF if it is in 1NF and all non-key attributes are
fully functional dependent on the primary key.