Skip to main content

Normalization

Normalization is the process of structuring a relational database to reduce data redundancy and improve data integrity. Each normal form builds on the previous one.

First Normal Form (1NF)

Rule: Every column must contain atomic (indivisible) values, and each row must be unique.

Violation: A Phone column storing multiple numbers in one cell.

CustomerIDNamePhone
1Alice111-111, 222-222

Fixed:

CustomerIDNamePhone
1Alice111-111
1Alice222-222

Violation: Multiple columns for the same attribute.

CustomerIDNamePhone1Phone2
1Alice111-111222-222

Fixed:

CustomerIDNamePhone
1Alice111-111
1Alice222-222

Second Normal Form (2NF)

Rule: Must be in 1NF, and every non-key attribute must depend on the entire primary key, not just part of it

Violation: The table uses (OrderID, ProductID) as a composite key, but ProductName depends only on ProductID.

OrderIDProductIDProductNameQuantity
142Keyboard2
242Keyboard1

Fixed: Move ProductName into a separate Products table.

Orders:

OrderIDProductIDQuantity
1422
2421

Products:

ProductIDProductName
42Keyboard

Third Normal Form (3NF)

Rule: Must be in 2NF, and no non-key attribute may depend on another non-key attribute (no transitive dependencies).

Violation: DepartmentHead depends on Department, not directly on EmployeeID.

EmployeeIDDepartmentDepartmentHead
1SalesCarol
2SalesCarol
3ITDave

Fixed: Move DepartmentHead into a separate Departments table.

Employees:

EmployeeIDDepartment
1Sales
2Sales
3IT

Departments:

DepartmentDepartmentHead
SalesCarol
ITDave

Summary

Normal FormRequirement
1NFAtomic values, no repeating columns, unique rows
2NF1NF + no partial dependencies on a composite key
3NF2NF + no transitive dependencies between non-key attributes