Course contentsShow
← System Design
Lesson 302 of 1,9199. SQL vs NoSQL TradeoffsFree lesson

Normalization Fundamentals

Organizing data to eliminate redundancy through normal forms, reducing update anomalies and maintaining consistency.

Normalization Fundamentals

What you'll learn: How organizing your database tables through normal forms eliminates redundancy and prevents data anomalies.

Normalization is the process of structuring your relational database to minimize redundant data and avoid update, insert, and delete anomalies. Think of it like organizing a messy closet—instead of having duplicate items scattered everywhere, you create designated places for each type of thing.

The Core Problem

Imagine storing customer orders in a single flat table where each row repeats customer details (name, email, address) for every order. When a customer updates their address, you'd need to update dozens of rows. Miss one? You now have inconsistent data. This is an update anomaly.

Normal Forms at a Glance

Normalization progresses through increasingly strict "normal forms":

  • First Normal Form (1NF): Eliminate repeating groups—each cell contains a single atomic value, not lists
  • Second Normal Form (2NF): Remove partial dependencies—non-key attributes depend on the entire primary key
  • Third Normal Form (3NF): Remove transitive dependencies—non-key attributes depend only on the primary key, not on other non-key attributes

The Solution in Action

Instead of one bloated Orders table, normalize into:

  • Customers table (customer_id, name, email, address)
  • Orders table (order_id, customer_id, order_date, total)
  • Order_Items table (order_item_id, order_id, product_id, quantity)

Now customer address updates happen once. Deleting an order doesn't erase customer existence. Each piece of information lives in exactly one place.

The Trade-off

Higher normalization reduces redundancy but requires joins to reconstruct full data pictures—a performance consideration we'll explore later.

Key Takeaway: Normalization organizes data into focused tables where each fact exists exactly once, eliminating redundancy and the inconsistencies that come from maintaining duplicate information across multiple locations.