Database DesignPro· 30 min read

Normalization Basics

Organise tables to avoid duplicated, inconsistent data — the foundation of good design.

What you will learn

  • Understand why we split data
  • Recognise good vs bad table design

Don’t repeat data

Normalization means structuring tables so each fact is stored once. Repeating a customer’s name in every order row is bad — if they change their name, you would have to update many rows (and might miss some).

Instead, store the customer once in users and reference them by user_id in orders. Change the name in one place; everything stays consistent.

Here is the problem with real rows. This bad orders table copies the customer’s name and email into every single order:

idcustomer_namecustomer_emailtotal
101Ashaasha@x.com500
102Raviravi@x.com250
103Ashaasha@x.com900

See how Asha and asha@x.com appear twice (rows 101 and 103)? If Asha changes her email, you must edit it in two places — and if you miss one, the data disagrees with itself. Now the good, normalized version splits it into two tables. The customer is stored once, and each order just points to her with a user_id:

users.idusers.nameusers.email
1Ashaasha@x.com
2Raviravi@x.com
orders.idorders.user_idorders.total
1011500
1022250
1031900

Now Asha’s email lives in exactly one row of users. Change it there and every order linked to her instantly shows the new value — nothing to miss, nothing to keep in sync. That is normalization in action.

Bad (repeated data)Good (normalized)
Each order stores the full customer name & emailOrders store user_id; users stores the details once
Update name → fix many rowsUpdate name → fix one row

Tip: Rule of thumb: if you find yourself copying the same value into many rows, it probably belongs in its own table, referenced by a key.

Q. Why normalize a database?

Answer: Normalization removes duplication so each fact lives in one place — keeping data consistent and easy to update.

✍️ Practice

  1. Spot the duplicated data in a poorly designed table and split it.
  2. Redesign it into two linked tables.

🏠 Homework

  1. Take a messy single-table design and normalize it into related tables.
Want to learn this with a mentor?

CodingClave runs guided, project-based training (28-day, 45-day & 6-month batches).

Explore Training →