Normal Forms   «Prev  Next»

Lesson 1

Normalization: 1NF, 2NF, and 3NF with Practical Examples

Normalization is a disciplined way to structure tables so that each fact is stored once and updates stay consistent. You don’t need advanced set theory, just a few rules and a repeatable workflow.

  • Why normalize? Preserve information from your conceptual model (entities, attributes, relationships) while minimizing redundancy and update anomalies.
  • How it fits: Works with both top-down (start from ERD) and bottom-up (start from attributes) design. Most real projects blend the two.

Learning Objectives

  1. Define normalization and functional dependency.
  2. Recognize and correct violations of First Normal Form (1NF), Second Normal Form (2NF), and Third Normal Form (3NF).
  3. Identify repeating groups, partial dependencies, and transitive dependencies.

Key Terms (Quick Ref)

First Normal Form (1NF)

Requirements:

Fix: Move repeating groups to a separate child table so each repeated value becomes a separate row.

Second Normal Form (2NF)

Applies when a table’s primary key is composite.

Third Normal Form (3NF)


Database Design for Mere Mortals

Worked Example: From UNF to 3NF

Scenario: An order record includes customer and line item details in one table with repeating groups.


OrderUNF(OrderID, OrderDate, CustomerID, CustomerName,
         Item1_ProductID, Item1_ProductName, Item1_Qty, Item1_UnitPrice,
         Item2_ProductID, Item2_ProductName, Item2_Qty, Item2_UnitPrice, ...)

-- 1NF: Eliminate repeating groups (one line per row)
OrderLine1NF(OrderID, OrderDate, CustomerID, CustomerName,
             ProductID, ProductName, Qty, UnitPrice)

-- Candidate key: (OrderID, ProductID) for OrderLine1NF
-- Check FDs (illustrative):
-- (OrderID → OrderDate, CustomerID)
-- (CustomerID → CustomerName)
-- (ProductID → ProductName)
-- (OrderID, ProductID → Qty, UnitPrice)

-- 2NF: Remove partial dependencies on a subset of the key
Order(OrderID, OrderDate, CustomerID)
Customer(CustomerID, CustomerName)
Product(ProductID, ProductName)
OrderLine(OrderID, ProductID, Qty, UnitPrice)
-- Now all non-key columns in OrderLine depend on the full key (OrderID, ProductID)

-- 3NF: Remove transitive dependencies (if any remain)
-- Example already handled: CustomerName depends on CustomerID, not on OrderID.
-- If UnitPrice were a catalog price (ProductID → UnitPrice),
-- move catalog price to Product and keep OrderLine.UnitPrice only if it captures
-- the historical price at order time (business rule).

Quick Checklist

Design Notes and Next Steps

SEMrush Software 1 SEMrush Banner 1