Module II Normal Form (NF1, NF2, NF3, BCNF)
Module II Normal Form (NF1, NF2, NF3, BCNF)
Jasmine
NORMAL FORMS
NORMALIZATION
Introduction
Database normalization is the process of organizing the attributes of database to reduce or
eliminate data redundancy (having same data but at different places) 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.
Problems because of data redundancy
Data redundancy unnecessarily increases size of database as same data is repeated on many
places. Inconsistency problems also arise during insert, delete and update operations.
Functional Dependency
Functional Dependency is a constraint between two sets of attributes in a relation from a
database. Functional dependency is denoted by arrow (→). If an attributed A functionally determines B,
then it is written as A → B.
For example employee_id → name means employee_id functionally determines name of
employee. As another example in a time table database, {student_id, time} → {lecture_room}, student
ID and time determine the lecture room where student should be.
A function dependency A → B mean for all instances of a particular value of A, there is same
value of B.
For example in the below table A → B is true, but B → A is not true as there are different values
of A for B = 3.
A B
1 3
2 3
4 0
1 3
4 0
1 Dr.I.Jasmine
DBMS – Module 2 Dr.I.Jasmine
2 Dr.I.Jasmine
DBMS – Module 2 Dr.I.Jasmine
3 Dr.I.Jasmine
DBMS – Module 2 Dr.I.Jasmine
Normal Description
Form
1NF A relation is in 1NF if it contains an atomic value.
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.
3NF A relation will be in 3NF if it is in 2NF and no transition dependency exists.
4NF A relation will be in 4NF if it is in Boyce Codd normal form and has no multi-valued
dependency.
5NF A relation is in 5NF if it is in 4NF and not contains any join dependency and joining
should be lossless.
Two employees (Jon & Lester) are having two mobile numbers so the company stored them in
the same field as seen in the table above.
This table is not in 1NF as the rule says “each attribute of a table must have atomic (single)
values”, the emp_mobile values for employees Jon & Lester violates that rule.
4 Dr.I.Jasmine
DBMS – Module 2 Dr.I.Jasmine
To make the table complies with 1NF the table should have the data like this:
emp_id emp_name emp_address emp_mobile
101 Herschel New Delhi 8912312390
102 Jon Kanpur 8812121212
102 Jon Kanpur 9900012222
103 Ron Chennai 7778881212
104 Lester Bangalore 9990000123
104 Lester Bangalore 8123450987
5 Dr.I.Jasmine
DBMS – Module 2 Dr.I.Jasmine
6 Dr.I.Jasmine
DBMS – Module 2 Dr.I.Jasmine
Example: Suppose a company wants to store the complete address of each employee, they create a table
named employee_details that looks like this:
emp_id emp_name emp_zip emp_state emp_city emp_district
1001 John 282005 UP Agra Dayal Bagh
1002 Ajeet 222008 TN Chennai M-City
1006 Lora 282007 TN Chennai Urrapakkam
1101 Lilly 292008 UK Pauri Bhagwan
1201 Steve 222999 MP Gwalior Ratan
7 Dr.I.Jasmine
DBMS – Module 2 Dr.I.Jasmine
8 Dr.I.Jasmine
DBMS – Module 2 Dr.I.Jasmine
9 Dr.I.Jasmine