Normalization_in_Database_Management_System
Normalization_in_Database_Management_System
Example
Let's consider a simple example of a student database:
Steps of Normalization
Example in 1NF:
StudentID StudentName CourseID CourseName Instructor
- It is in 1NF.
- All non-key attributes are fully functional dependent on the primary key.
Steps to achieve 2NF:
Example:
Separate the table into two:
Students Table:
StudentID StudentName
1 Alice
2 Bob
3 Charlie
Courses Table:
CourseID CourseName Instructor
Enrollment Table:
StudentID CourseID
1 101
2 102
1 103
3 101
- It is in 2NF.
- There are no transitive dependencies (i.e., non-key attributes are not dependent on
other non-key attributes).
Example:
Our tables from 2NF are already in 3NF as there are no transitive dependencies.
4. Boyce-Codd Normal Form (BCNF)
Rule: A table is in BCNF if:
- It is in 3NF.
- For every functional dependency (A → B), A should be a super key.
Example:
In our case, each functional dependency has the left side as a super key in their respective
tables, so they are also in BCNF.
Summary
- 1NF: Ensure the table has atomic columns and unique rows.
- 2NF: Ensure full functional dependency of non-key attributes on the primary key.
- 3NF: Remove transitive dependencies.
- BCNF: Ensure every determinant is a super key.
This process of normalization helps to reduce redundancy and improve data integrity,
making the database more efficient and easier to maintain.