🌱

Database Normalization

Master the art of organizing data to reduce redundancy and improve integrity.

Section 1 of 5: Why Normalize Data?0%

Why Normalize Data?

Study Material

Normalization is the process of organizing data to minimize redundancy and dependency. It's one of the most important concepts in relational database design.

The Problem Without Normalization:

Imagine storing customer orders like this (unnormalized):

OrderIDCustomerNameCustomerEmailCustomerPhoneProductPriceQty
1John Smithjohn@email.com555-0100Laptop9991
2John Smithjohn@email.com555-0100Mouse292
3Jane Doejane@email.com555-0200Laptop9991
4John Smithjohn@email.com555-0100Keyboard791

Issues with this design:

1. Data Redundancy 💾

  • John's info (name, email, phone) repeated 3 times
  • Laptop price repeated twice
  • Wastes storage space
  • More data to maintain

2. Update Anomaly ✏️

  • If John changes his email, must update multiple rows
  • Easy to miss some rows → inconsistent data
  • "Which email is correct?"

3. Delete Anomaly 🗑️

  • If we delete Jane's only order, we lose her customer info entirely
  • Can't have customers without orders

4. Insert Anomaly ➕

  • Can't add a new customer until they place an order
  • Can't add a new product until someone buys it

Goals of Normalization:

Eliminate duplicate data
Ensure data consistency
Reduce storage space
Simplify data maintenance
Improve data integrity
Make updates atomic and reliable

When NOT to Normalize (Preview):

While normalization is great for OLTP systems, analytical systems often benefit from denormalization. We'll cover this in the next module!