0% found this document useful (0 votes)
27 views

Normalization

1. Normalization is a process of organizing data in a database to reduce data redundancy and inconsistencies. 2. There are three types of anomalies that can occur without normalization: insert anomaly, update anomaly, and delete anomaly. 3. The document discusses the concepts of first normal form (1NF), second normal form (2NF), third normal form (3NF), and Boyce-Codd normal form (BCNF) as part of the normalization process.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Normalization

1. Normalization is a process of organizing data in a database to reduce data redundancy and inconsistencies. 2. There are three types of anomalies that can occur without normalization: insert anomaly, update anomaly, and delete anomaly. 3. The document discusses the concepts of first normal form (1NF), second normal form (2NF), third normal form (3NF), and Boyce-Codd normal form (BCNF) as part of the normalization process.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

NORMALIZATION

Normalization
• Normalization is a process of organizing the data in
database to avoid data redundancy, insertion anomaly,
update anomaly & deletion anomaly.

Anomalies in DBMS
• There are three types of anomalies that occur when the
database is not normalized.
• Insert anomaly
• Update anomaly
• Delete anomaly
Anomalies in DBMS
• Update anomaly: If we want to update the

emp_id emp_name address dept


address of John then we have to update the
101 John Delhi D001 same in two rows or the data will become
101 John Delhi D002 inconsistent and would lead to inconsistent data.
123 William Agra D890
166 Glenn Chennai D900
166 Glenn Chennai D004 • Insert anomaly: Suppose a new employee joins
the company, who is under training and currently
not assigned to any department then we would
not be able to insert the data into the table if
emp_dept field doesn’t allow nulls.

• Delete anomaly: Suppose, if at a point of time


the company closes the department D890 then
deleting the rows that are having dept as D890
would also delete the information of employee
William since she is assigned only to this
department.
Normalization

The most commonly used normal forms:

• First normal form(1NF)


• Second normal form(2NF)
• Third normal form(3NF)
• Boyce & Codd normal form (BCNF)
First normal form (1NF)
emp_id emp_name address mobile • Two employees (Jon &
101 Herschel New Delhi 8912312390

102 Jon Kanpur


8812121212 Lester) are having two
103 Ron Chennai
9900012222
7778881212
mobile numbers so the
104 Lester Bangalore
9990000123 company stored them in
8123450987
the same field.

• 1NF as the rule says


emp_id emp_name emp_address emp_mobile each attribute of a table
101 Herschel New Delhi 8912312390 must have atomic
102 Jon Kanpur 8812121212
102 Jon Kanpur 9900012222 (single) values.
103 Ron Chennai 7778881212
104 Lester Bangalore 9990000123
104 Lester Bangalore 8123450987 • This table is not in 1NF
Second normal form (2NF)
A table is said to be in 2NF if both the following
conditions hold:

1. Table is in 1NF (First normal form)

2. The primary key of the table should compose


of exactly 1 column.
2NF
• Suppose a school wants to store the
data of teachers and the subjects they
• Teacher_details
teach
teacher_id teacher_age
teacher_id subject teacher_age 111 38
111 Maths 38
111 Physics 38
222 38
222 Biology 38 333 40
333 Physics 40
333 Chemistry 40

• The table is in 1 NF because each


attribute has atomic values. However, • Teacher_subject
teacher_id subject
it is not in 2NF because non prime 111 Maths
attribute teacher_age is dependent on 111 Physics
teacher_id alone which is a proper
subset of candidate key. This violates 222 Biology
the rule for 2NF 333 Physics
Third Normal form (3NF)
The third normal form, the following conditions are
required:

1. The table should be in the second normal form.


2. There should not be any functional dependency
3NF
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

Employee Employee_zip
emp_id emp_name emp_zip emp_zip emp_state emp_city emp_district
1001 John 282005 282005 UP Agra Dayal Bagh
1002 Ajeet 222008 222008 TN Chennai M-City
1006 Lora 282007 282007 TN Chennai Urrapakkam
1101 Lilly 292008 292008 UK Pauri Bhagwan
1201 Steve 222999 222999 MP Gwalior Ratan
Boyce Codd normal form (BCNF)
emp_id emp_nationality emp_dept dept_type dept_no_of_emp
1001 Austrian Production and planning D001 200
1001 Austrian stores D001 250
1002 American design and technical support D134 100
1002 American Purchasing department D134 600

emp_dept_mapping
emp_nationality emp_dept
emp_dept dept_type dept_no_of_emp emp_id emp_dept
emp_id emp_nationality
Production and planning D001 200 1001 Production and planning
1001 Austrian stores D001 250 1001 stores
1002 American design and technical support D134 100 1002 design and technical support
Purchasing department D134 600 1002 Purchasing department

You might also like