Normalization in Database (1NF,
2NF, 3NF)
Student, Employee, and Library
Tables
Unnormalized Table
• ROLL NO | NAME | ROLE |
DEPARTMENT | BOOKS ISSUED | SALARY |
DESIGNATION
• 1 | Student A | Student | CS |
Book1, Book2 | - | -
• 22 | Employee B | Employee | Admin |
- | 50000 | Manager
• 45 | Librarian C| Library | - | Book3
|- |-
1NF (First Normal Form)
• 1NF ensures each column contains atomic
values (no repeating groups):
• ROLL NO | NAME | ROLE |
DEPARTMENT | BOOK ISSUED | SALARY |
DESIGNATION
• 1 | Student A | Student | CS |
Book1 |- |-
• 1 | Student A | Student | CS |
Book2 |- |-
2NF (Second Normal Form)
• 2NF eliminates partial dependency by
decomposing tables:
• PERSON Table:
• ROLL NO | NAME | ROLE |
DEPARTMENT | SALARY | DESIGNATION
• 1 | Student A | Student | CS |-
|-
• 22 | Employee B | Employee | Admin |
50000 | Manager
3NF (Third Normal Form)
• 3NF eliminates transitive dependency:
• PERSON Table:
• ROLL NO | NAME | ROLE |
DEPARTMENT | SALARY | DESIGNATION
• 1 | Student A | Student | CS |-
|-
• 22 | Employee B | Employee | Admin |
50000 | Manager