DBMS Normalization (1NF, 2NF, 3NF) — Easy Guide with Examples
Introduction
Normalization
in DBMS is a process used to organize data in a database to reduce redundancy
and improve data integrity. It divides large tables into smaller, related
tables and removes data duplication.
Normalization
is performed in steps called Normal Forms:
- First Normal Form (1NF)
- Second Normal Form (2NF)
- Third Normal Form (3NF)
Let’s
understand each in a simple way.
What is
Normalization?
Normalization is the process of structuring a
database to:
- Remove data redundancy
- Avoid update anomalies
- Improve data consistency
- Maintain data integrity
It is mainly
used in Relational Database Management Systems (RDBMS).
🔹 First Normal Form (1NF)
Rule of
1NF
A table is in
First Normal Form (1NF) if:
- Each field contains atomic
(single) values
- No repeating groups or
multivalued attributes
- Each record is unique
Example
(Not in 1NF)
Students
table
|
StudentID |
Name |
Subjects |
|
101 |
Ali |
DBMS, SQL |
|
102 |
Sara |
Java |
Problem:
Subjects column has multiple values.
Converted
to 1NF
|
StudentID |
Name |
Subject |
||
|
101 |
Ali |
DBMS |
||
|
101 |
Ali |
SQL |
||
|
102 |
Sara |
Java |
||
Now each
field has a single value.
🔹 Second Normal Form (2NF)
Rule of
2NF
A table is in
Second Normal Form (2NF) if:
- It is already in 1NF
- No partial dependency
- Non-key attributes depend on the whole
primary key
Applies
mainly to composite keys.
Example
(Not in 2NF)
Enrollment
table
|
StudentID |
CourseID |
StudentName |
CourseName |
Primary
Key: (StudentID,
CourseID)
Problem:
- StudentName depends only on
StudentID
- CourseName depends only on
CourseID
This is
partial dependency.
Converted
to 2NF
Students
table
|
StudentID |
StudentName |
Courses
table
|
CourseID |
CourseName |
Enrollment
table
| StudentID |
CourseID |
Partial
dependency removed.
🔹 Third Normal Form (3NF)
Rule of
3NF
A table is in
Third Normal Form (3NF) if:
- It is in 2NF
- No transitive dependency
- Non-key attributes depend only
on the primary key
Example
(Not in 3NF)
Students
table
|
StudentID |
DeptID |
DeptName |
Problem:
- DeptName depends on DeptID
- DeptID depends on StudentID
This is
transitive dependency.
Converted
to 3NF
Students
table
|
StudentID |
DeptID |
Departments
table
|
DeptID |
DeptName |
Transitive
dependency removed.
Quick
Memory Trick
- 1NF → Remove repeating groups
- 2NF → Remove partial dependency
- 3NF → Remove transitive dependency
Benefits
of Normalization
- Reduces data redundancy
- Improves data consistency
- Saves storage space
- Easier database maintenance
- Better data integrity
Disadvantages
of Over-Normalization
- Too many tables
- Complex queries
- More joins required
- Slight performance overhead
In real
systems, sometimes controlled denormalization is used.
Conclusion
Normalization
is a key concept in DBMS that helps design efficient and reliable databases. By
applying 1NF, 2NF, and 3NF, we can remove redundancy, avoid anomalies, and
maintain data integrity. Every database designer should clearly understand
normalization for building scalable database systems.

Comments
Post a Comment