NORMALIZATION
What is Normalization?
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity by splitting large tables into smaller related ones and defines relationships between them using foreign keys.
It helps:
- Reduce redundancy (duplicate data)
- Ensure data integrity
- Improve data consistency, efficiency, accuracy.
Data redundancy unnecessarily increases the size of the database as the same data is repeated in many places.
Normalization generally involves splitting a table into multiple ones which must be linked each time a query is made requiring data from the split tables.
It helps prevent:
🔁 Update anomalies (e.g., inconsistent updates)
Updation anomalies occur when modifying data in a database and can result in inconsistencies or errors. For example, if a database contains information about employees and their salaries, updating an employee’s salary in one record but not in all related records could lead to incorrect calculations and reporting.
Occurs when data is duplicated, and you need to update it in multiple places — and if you miss one, the data becomes inconsistent.
🔴 Problem:
- If you miss even one row, you’ll have inconsistent instructor data
- Time-consuming and error-prone
➕ Insertion anomalies (e.g., can’t insert partial data) :
Insertion anomalies occur when it is not possible to insert data into a database because the required fields are missing or because the data is incomplete. For example, if a database requires that every record has a primary key, but no value is provided for a particular record, it cannot be inserted into the database.
🔴Problem:
- We are forced to insert
NULLfor student details - This is invalid and breaks data integrity
➖ Deletion anomalies (e.g., deleting one item removes unrelated data)
Deletion anomalies occur when deleting a record from a database and can result in the unintentional loss of data. For example, if a database contains information about customers and orders, deleting a customer record may also delete all the orders associated with that customer.
🔴 Problem:
- We also lose all information about the “History” course and the instructor
- Even if other students might take History later, the course info is gone
Before Normalization: The table is prone to redundancy and anomalies (insertion, update, and deletion).
Get hansini gunasena’s stories in your inbox
Join Medium for free to get updates from this writer.
After Normalization: The data is divided into logical tables to ensure consistency, avoid redundancy and remove anomalies making the database efficient and reliable.
Normal Forms in DBMS
🔸 1NF — First Normal Form
✅ Rule:
- Atomic values only (no lists or repeating groups)
🔴 Problem:
- Courses and Instructors are multi-valued fields → violates atomicity
- Hard to query or update individual courses
✅ Solves:
- 🔁 Update Anomaly: Can now update
Instructorfor only Science - ➕ Insertion Anomaly: Can add new course without duplicating full row
- ➖ Deletion Anomaly: Deleting Math doesn’t lose all student info
🔸 2NF — Second Normal Form
✅ Rule:
- Be in 1NF
- No partial dependency: non-key attributes must depend on the whole primary key
🔴 Problem:
StudentNamedepends only onStudentID, not on(StudentID + Course)
→ Partial dependency
✅ Solves:
- 🔁 Update Anomaly: Changing
StudentNameonly in one place - ➕ Insertion Anomaly: Can add new student without needing course
- ➖ Deletion Anomaly: Removing course doesn’t delete student data
🔸 3NF — Third Normal Form
✅ Rule:
- Be in 2NF
- No transitive dependency: non-key attributes cannot depend on other non-key attributes
🔴 Problem:
Instructordepends onCourse, not directly on primary key
→ Transitive dependency
✅ Solves:
- 🔁 Update Anomaly: Change
Mr. Smithonly once inCoursetable - ➕ Insertion Anomaly: Can add new course before assigning instructor
- ➖ Deletion Anomaly: Deleting last enrollment in a course doesn’t lose instructor info
🔸 BCNF — Boyce-Codd Normal Form
✅ Rule:
- Be in 3NF
- Every determinant must be a super key
Assume:
- Each Instructor teaches in only one Room
→ Functional dependency:Instructor → Room
ButCourseis the primary key → violates BCNF
✅ Solves:
- 🔁 Update Anomaly: Instructor room updates done in one place
- ➕ Insertion Anomaly: Can add new instructor + room before assigning courses
- ➖ Deletion Anomaly: Deleting a course doesn’t remove instructor-room info








