Normalization, Keys and Constraints - Database Cheat Sheet
The normalization staircase from a flat table to 3NF, with a real update anomaly happening in front of you. Then the keys and constraints that protect your data, each shown with SQLite's own answer when you break it.
On the sheet:
- The normalization staircase: unnormalized to 3NF
- The three anomalies: a real update anomaly, measured
- Functional dependency: the idea behind 2NF and 3NF
- 1NF, 2NF and 3NF: before and after for each
- Is my table normalized?: three questions to ask
- Junction table: a composite primary key
- Foreign keys: off until you switch them on
- Four guards: NOT NULL, UNIQUE, CHECK and DEFAULT
- Common mistakes: four, each with its measured result
Two A4 pages, printed front and back, sized to print once and keep beside you while you work. Written in short sentences and plain English, for readers whose first language is not English and clearer for everyone else because of it.
It pairs with the Normalization Without Tears and Keys, Links & Constraints books, so you can learn each idea in full and then revise it here in two pages.
Every query on this sheet was run against a live database before the page was printed, so the result you read is the result you get. Instant PDF download. By M.R. Sterling.