← back to databases

Normalization

Wikipedia · wpDatabase normalization · CC BY-SA 4.0

Normalization eliminates redundancy by decomposing tables based on functional dependencies. Each normal form (1NF through BCNF) removes a specific kind of anomaly. The goal: every fact is stored exactly once, so updates cannot create inconsistencies.

sid sname dept dhead 1 Alice CS Turing 2 Bob CS Turing 3 Carol Math Gauss redundant: CS/Turing repeated sid sname dept 1 Alice CS 2 Bob CS 3 Carol Math dept dhead CS Turing Math Gauss Decompose to eliminate redundancy.

Functional dependencies

A functional dependency X -> Y means: if two tuples agree on attributes X, they must agree on Y. Example: student_id -> name (knowing the ID determines the name). Normalization decomposes tables so that each non-key attribute depends on the whole key and nothing but the key.

Scheme

Normal forms: 1NF through BCNF

1NF: every cell holds an atomic value (no lists, no nested tables). 2NF: no partial dependency (every non-key attribute depends on the entire primary key, not just part of it). 3NF: no transitive dependency (non-key attributes do not depend on other non-key attributes). BCNF: for every functional dependency X -> Y, X is a superkey.

Python
Neighbors

Foundations (Wikipedia)