Normalization
Normalization
Normalization is the process of organizing data in a database to reduce redundancy (repeated data) and
ensure data integrity (accuracy and consistency).
Example of 1NF:
Problem: The "Subjects" column has multiple subjects in one cell, which violates the 1NF rule.
Table in 1NF:
Now, the table is in 1NF because each cell has only one value, and there are no repeating groups.
1. It is already in 2NF.
2. There is no partial dependency — every non-key column must depend on the entire primary key,
not just a part of it.
Example:
Here, the TeacherName is dependent on TeacherID, but TeacherID is not the primary key of the table (it
is a composite key made of StudentID + Subject). This creates a partial dependency.
1. Student-Subject Table:
2. Teacher table:
TeacherID TeacherName
1 Mr. Ravi Singh
2 Ms. Asha Thapa
3NF removes transitive dependencies. A table is in 3NF if it is in 2NF, and no non-key attribute depends
on another non-key attribute.
Rules:
No transitive dependencies (i.e., non-key attributes should not depend on other non-key attributes).
Here, TeacherPhone is dependent on TeacherName, not directly on TeacherID (the key). This is a
transitive dependency.
2. Teacher Table:
Advantages of Normalization
• Reduced data redundancy: Normalization helps to eliminate duplicate data in tables, reducing the
amount of storage space needed and improving database efficiency.
• Improved data consistency: Normalization ensures that data is stored in a consistent and
organized manner, reducing the risk of data inconsistencies and errors.
• Simplified database design: Normalization provides guidelines for organizing tables and data
relationships, making it easier to design and maintain a database.
• Improved query performance: Normalized tables are typically easier to search and retrieve data
from, resulting in faster query performance.
• Easier database maintenance: Normalization reduces the complexity of a database by breaking it
down into smaller, more manageable tables, making it easier to add, modify, and delete data.