1. Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423 603
(An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune)
NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified
Department of Computer Engineering
(NBA Accredited)
Prof. Monika Agrawal
Assistant Professor
E-mail : [email protected]
Contact No: 8770361037
Course:CO210
Database Management System
Lecture-04 1NF 2NF
2. Content
s
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 2
Normalization Rule
First Normal Form
Second Normal Form
3. Normalization Rule
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 3
Normalization is a process of organizing the data in database to avoid
data redundancy, insertion anomaly, update anomaly & deletion
anomaly.
Normalization is a systematic approach of decomposing tables to
eliminate data redundancy.
Normalization rules are divided into the following normal forms:
First Normal Form
Second Normal Form
Third Normal Form
BCNF
4. First Normal Form
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 4
1NF
Above table is not in First Normal Form. In 1NF any row must not have a column
in which more than one value is saved like separated with commas.
As per 1NF no two rows of data must contain repeating group of information i.e
each set of column must have a unique value, such that multiple columns can not
be used to fetch the same row.
Each table organized into rows and each row should have a primary key.
Student Age Subject
Ram 15 Biology, Maths
Vinay 14 Maths
Sham 17 Maths
5. First Normal Form (Cont.)
Before 1NF
After 1NF
Student Age Subject
Ram 15 Biology
Ram 15 Maths
Vinay 14 Maths
Sham 17 Maths
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 5
6. 2NF
• Table must be in 1NF
• As per 2NF there must not be any partial dependency of any column on primary
key or candidate key.
• If any column depends only on one part of concatenated key then the table fails
second normal form.
• In above table the candidate key is {student, subject}. Age depends only on
Student column not on Subject column means, Age column depends on part of
candidate key. It is incorrect as per 2NF.
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 6
7. 2NF (Cont.)
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 7
• For second normal form split out the subjects in to an independent
table and match them up using the student names as foreign key.
• After 2NF
Student table Subject table
Student Age
Ram 15
Vinay 14
Sham 17
Student Subject
Ram Biology
Ram Maths
Vinay Maths
Sham Maths