| Lesson 3 | Why We Need Normalization |
| Objective | Explain why normalization reduces redundancy and helps prevent insertion, update, and deletion anomalies. |
The main objective of normalization is to organize facts according to their dependencies so that they can be maintained consistently without unnecessary repetition. A sound decomposition preserves the information in the original relation while reducing insertion, update, and deletion anomalies.
Normalization does not aim to eliminate every repeated value. Many orders may reference the same customer, and many order lines may reference the same item. Those references record distinct relationships. The avoidable repetition occurs when each relationship also stores another copy of a fact, such as the customer's current telephone number.
This lesson focuses on why a design needs normalization. The previous lesson explains the normalization process; the following lessons develop the individual normal forms.
The original teaching data below records four orders and their items. Its dates and abbreviated contact details are illustrative. Each displayed row contains one item, but the business permits an order to contain several different items.
Assume each order belongs to one customer, each item occurs at most once per order, and the customer details represent current information. Title is the item's current title, Price is the price charged on that order line, and Shipped describes that line's shipping status. Under these assumptions, the candidate key is (OrderNo, ItemNo); the four currently distinct order numbers do not establish that OrderNo alone is a key.
| CustID | CustName | Address | Phone | OrderDate | OrderNo | ItemNo | Title | Price | Shipped |
|---|---|---|---|---|---|---|---|---|---|
| 101 | C. Frye | Portland | 230.1251 | 2017-01-11 | 101 | 105 | MX | 14.95 | YES |
| 101 | C. Frye | Portland | 230.1251 | 2017-01-11 | 102 | 108 | CX | 15.95 | YES |
| 102 | D. Loge | DC | 555.1234 | 2017-01-12 | 103 | 105 | MX | 14.95 | YES |
| 102 | D. Loge | DC | 555.1234 | 2017-01-13 | 104 | 109 | DX | 13.95 | YES |
This table is already presented in 1NF form: there are no numbered repeating item groups or lists of values in its cells. Its width is not the reason to decompose it. The problem is that attributes depend on different identifiers, causing facts to repeat across rows.
Customer 101's name, address, and phone appear on orders 101 and 102. Customer 102's details appear on orders 103 and 104. Item 105's title appears for two different orders. These are repeated descriptions of the same customers and item.
The relevant dependencies are:
CustID → CustName, Address, Phone
OrderNo → OrderDate, CustID
ItemNo → Title
(OrderNo, ItemNo) → Price, Shipped
Each dependency expresses a business rule, not merely a pattern in this sample. Two identical prices for item 105 do not prove that ItemNo determines its sale price; another order could receive a discount.
If customer 101 changes their current phone number, both of that customer's rows need updating. A missed row leaves conflicting contact information. More orders mean more places where the same fact must be maintained.
A Customer table keyed by CustID gives the current phone number one place to be updated. Orders continue to reference customer 101, so queries can retrieve the new number without changing every order line.
If customer and item information exists only in this combined table, recording a new customer or item requires an order-line row. Required order identifiers prevent adding the independent fact on its own.
Separate Customer and Product tables allow the business to register a customer before their first purchase and add an item before its first sale. Normalization aligns the storage structure with those independent lifecycles.
Suppose the row for order 104 is removed. It is the only displayed row containing item 109 and the title DX. In the combined design, deleting that order line also loses the item's description if no other copy exists.
When product details live in Product, removing an order line leaves the product intact. Foreign-key deletion rules still need deliberate configuration: normalization alone does not decide whether deleting a customer should be blocked, cascaded, or handled through another policy.
A suitable design for the stated rules is:
Customer(CustID, CustName, Address, Phone)
Product(ItemNo, Title)
Orders(OrderNo, OrderDate, CustID)
OrderLine(OrderNo, ItemNo, Price, Shipped)
Primary keys:
Customer: CustID
Product: ItemNo
Orders: OrderNo
OrderLine: (OrderNo, ItemNo)
Foreign keys:
Orders.CustID → Customer.CustID
OrderLine.OrderNo → Orders.OrderNo
OrderLine.ItemNo → Product.ItemNo
Notice that every attribute from the original table has a home, including Shipped. Customer and product descriptions are separated from the order-line facts; their identifiers remain as references.
Moving attributes that depend on only part of the composite order-line key addresses 2NF. Separating customer details from order details also removes the transitive dependency through CustID, producing a 3NF design under these rules. These are distinct dependency checks, even when a designer performs the decompositions together.
If Shipped describes an entire order instead, it belongs in Orders. If partial shipments must be tracked, a separate shipment structure may be necessary. Likewise, a historical delivery address is a different fact from a customer's current address. Define the meaning of each attribute before deciding where it belongs.
A decomposition must support a lossless join: reconstructing the combined information must neither lose valid associations nor introduce false combinations. Here each order line joins to one order, one product, and the order's one customer through their keys.
Preserving dependencies also matters. Rules should remain enforceable in the resulting relations where possible. Primary keys prevent duplicate identifiers or pairs; foreign keys protect references; nullability and other constraints express additional requirements. Normalization helps create a sound structure, but it cannot guarantee correct input or replace those constraints.
Check all candidate keys, not just the chosen primary key. Adding a surrogate identifier does not remove the dependencies among the other attributes.
Normalization improves the structure for maintaining facts, but it does not guarantee faster queries or minimum storage. Additional joins may have a cost, while narrower rows and fewer repeated updates may provide benefits. Evaluate the actual workload before changing a sound design for performance.
Indexes, query changes, caching, and materialized summaries may address measured bottlenecks. Deliberate denormalization requires a documented source of truth and a reliable way to keep repeated data consistent. It should be a justified trade-off rather than an assumption that fewer tables must be better.
For each table, ask: What does one row represent? Which attributes determine the others? Can an independent fact be added or removed safely? Can the decomposed tables reconstruct the original relationships?
Review redundancy and repeated values or foreign keys if needed, then try the Normalization Process Quiz. Continue to first normal form for the next lesson.