Store each fact once, by splitting data into tables, so it cannot disagree with itself.
Normalization means organising tables so that every fact is stored exactly once. If a customer's city is written in one place, it can never disagree with itself.
Imagine one spreadsheet that holds every order. Each row repeats the customer's name, city and zip code, plus the product's name and price. It looks easy, but the same fact appears again and again. This causes three kinds of trouble, called anomalies:
| Anomaly | What goes wrong | Example |
|---|---|---|
| Update | You change a fact in some rows but not all, so the data contradicts itself | Asha moves to Mumbai. Two of her five rows say Pune, three say Mumbai. |
| Insert | You cannot store a fact until something else exists | You cannot add a new product until someone orders it. |
| Delete | Removing one thing destroys an unrelated fact | Deleting a customerโs only order also deletes the productโs price. |
Normalization fixes this by following a few rules, called normal forms. Each form removes one kind of repetition.
| Form | Rule in plain words | Fixes |
|---|---|---|
| 1NF | Each cell holds one value. No lists in a cell, no repeating columns like phone1, phone2, phone3. | Cells you cannot search or change cleanly |
| 2NF | Every non-key column depends on the whole key, not on a part of it. (Only matters when the key has several columns.) | Facts about the order stored on every order line |
| 3NF | Non-key columns depend on the key and nothing else. No column that really depends on another non-key column. | Facts like zone that depend on zip, not on the order |
| BCNF | A slightly stricter 3NF: every determining column must be a key. | Rare edge cases |
| Concept | Meaning | Example |
|---|---|---|
| Primary key | A column (or columns) that identifies a row uniquely | order_id, or (order_id, line_no) |
| Foreign key | A column that points to a row in another table | orders.customer_id โ customers.id |
| Partial dependency | A column depends on only part of a composite key | customer city depends on order_id, not on (order_id, line_no) |
| Transitive dependency | A column depends on another non-key column | zone depends on zip, and zip depends on the key |
| Normalized | Denormalized | |
|---|---|---|
| Facts stored | Once | Several times, on purpose |
| Writes | Simple and safe: change one row | More work: change every copy |
| Reads | Need joins | Fast, often one table |
| Good for | Live apps with many updates (OLTP) | Read-heavy reports and caches |
| Risk | Slow reads if you join too much | Copies drifting apart |
| order | line | customer | city | zip | zone | product | price | qty |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | Asha | Pune | 411001 | West | Pen | 2 | 10 |
| 1 | 2 | Asha | Pune | 411001 | West | Book | 9 | 1 |
| 2 | 1 | Ben | Leeds | LS1 | North | Pen | 2 | 4 |
| 3 | 1 | Asha | Pune | 411001 | West | Pen | 2 | 6 |
| 3 | 2 | Asha | Pune | 411001 | West | Lamp | 25 | 1 |
| 4 | 1 | Chen | Leeds | LS1 | North | Book | 9 | 2 |
| 5 | 1 | Ben | Leeds | LS1 | North | Lamp | 25 | 1 |
| 6 | 1 | Chen | Leeds | LS1 | North | Pen | 2 | 3 |
A fixed, made-up dataset of 8 order lines. The counts are exact for this data, but real savings depend on how much your data repeats. In the 3NF view the city lives in a zip-code table purely to show a transitive dependency (zip โ city and zone), which is a simplification.
| Term | Meaning in easy words |
|---|---|
| Normalization | Organising tables so each fact is stored once |
| Anomaly | A bug caused by a repeated fact: update, insert or delete |
| Normal form | A named rule for how tables should be arranged (1NF, 2NF, 3NF) |
| Primary key | The column or columns that identify a row |
| Foreign key | A column that points to a row in another table |
| Atomic value | A single value in a cell, not a list |
| Partial dependency | A column that depends on only part of a composite key |
| Transitive dependency | A column that depends on another non-key column |
| Join | Combining rows from two tables using a key |
| Denormalization | Copying data back on purpose to make reads faster |
| Redundancy | The same fact stored in more than one place |
| Choice | We gain | We lose |
|---|---|---|
| Fully normalized (3NF) | Correctness, simple writes | Joins on every read |
| Partly normalized | A balance of both | Needs judgement about what to copy |
| Denormalized | Fast reads | Copies to keep in sync, risk of drift |
| Very high normal forms | Tiny theoretical gains | Many tiny tables, slow queries |
| Normalized + indexes on keys | Fast joins and correct data | Extra index storage and write cost |
| Normalized source + summary tables | Correct data and fast reports | A refresh job to maintain |