Database Normalisation
Not in 1 NF
emp_id emp_name emp_address emp_mobile
101 Herschel New Delhi 8912312390
8812121212
102 Jon Kanpur
9900012222
103 Ron Chennai 7778881212
9990000123
104 Lester Bangalore
8123450987
Convert to 1NF
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
Not in 2NF
teacher_id subject teacher_age
111 Maths 38
111 Physics 38
Example: Suppose a school wants to store the data of teachers and the subjects they teach. They create a table that looks like this: Since a teacher can te
222 Biology 38
333 Physics 40
333 Chemistry 40
Convert to 2NF
To make the table complies with 2NF we can break it in two tables :
teacher_details and teacher_subject.
teacher_id teacher_age
111 38
222 38
333 40
teacher_id subject
111 Maths
111 Physics
222 Biology
333 Physics
333 Chemistry
Not in 3NF
Example: Suppose a company wants to store the complete
address of each employee, they create a table named
employee_details :
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
Convert to 3NF
• To make this table complies with 3NF we have to break the table into two
tables to remove the transitive dependency
employee table:
employee table:
emp_id emp_name emp_zip
1001 John 282005
1002 Ajeet 222008
1006 Lora 282007 employee_zip table:
1101 Lilly 292008 emp_zip emp_state emp_city emp_district
1201 Steve 222999 282005 UP Agra Dayal Bagh
222008 TN Chennai M-City
282007 TN Chennai Urrapakkam
292008 UK Pauri Bhagwan
222999 MP Gwalior Ratan