Types of Normalization
Types of Normalization
Pratibha Rashmi
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)
p_id Colour
1 Red
1 Yellow
2 Blue
3 Green
3 Red
A table is said to be in 2NF if both the
following conditions hold:
Table 2: t_subject
t_subject
t_id subject
1 DBMS
1 Networking
2 OS
2 DM
3 AI
tb_Student tb_Zip
s_id s_name zip zip city district state
1 Jaunty 110001 110001 Delhi Delhi Delhi
2 Arnav 282005 282005 Agra Agra UP
3 Ram 200201 200201 Aligarh Aligarh UP
4 Reeta 250001 250001 Meerut Meerut UP
5 Sita 110013 110013 Delhi Delhi Delhi
Even when a database is in 3rd Normal
Form, still there would be anomalies resulted
if it has more than one Candidate Key.
BCNF is an advance version of 3NF that’s why
it is also referred as 3.5NF.
BCNF is stricter than 3NF.
A table complies with BCNF if it is in 3NF
and for every functional dependency X->Y, X
should be the super key of the table.
Let's assume there is a company where
employees work in more than one
department.
tb_employee
e_id e_country e_dept dept_type e_dept_id
1 India Sales D003 1003
1 India Account D003 1008
2 USA Developing D001 1001
2 USA Designing D001 1006
3 UK Sales D003 1007
In the above table Functional dependencies are as follows:
e_id → e_country
e_dept → {dept_type, e_dept_id}
Candidate key: {e_id, e_dept}
The table is not in BCNF because neither e_dept nor e_id alone
are keys.
To
convert the given table into BCNF, we
decompose it into three tables:
Table 1:
tb_emp_country
e_id e_country Table 2:
1 India tb_emp_dept
2 USA e_dept dept_type e_dept_id
3 UK Sales D003 1003
Table 3: Account D003 1008
tb_emp_dept_mapping Developing D001 1001
e_id e_dept Designing D001 1006
1 Sales Sales D003 1007
1 Account
2 Developing
2 Designing
3 Sales
Functional
dependencies:
e_id → e_country
e_dept → {dept_type, e_dept_id}
Candidate keys: