Why Normalize?

What is Normalization?

Normalization is the process of organising columns and tables so that each fact is stored in exactly one place. It is done in steps called normal forms (1NF, 2NF, 3NF, BCNF...). Each form removes a specific kind of redundancy.

The Problem: Anomalies

Consider one wide table that stores orders together with customer and product details:

OrderIDCustomerNameCustomerCityProductNamePriceQty
101Aarav TradersMumbaiBasmati Rice 5kg12.5010
101Aarav TradersMumbaiGreen Tea 100 bags6.755
104Aarav TradersMumbaiGreen Tea 100 bags6.753
  • Update anomaly: if Aarav Traders moves to Pune, three rows must change; miss one and the data contradicts itself.
  • Insert anomaly: you cannot record a new product until somebody orders it.
  • Delete anomaly: deleting order 102 might delete the only record that a product or customer ever existed.

Key Terms

TermMeaning
Functional dependency (A → B)knowing A determines B. CustomerID → CustomerCity
Candidate keya minimal set of columns that uniquely identifies a row
Prime attributea column that is part of some candidate key
Partial dependencya non-key column depends on part of a composite key
Transitive dependencya non-key column depends on another non-key column