Chapter 3 — Further Reading
Deepen the model. Optional, tagged by path. Chapter 4 follows directly from this one, so if you read anything, make it the relational-algebra preview.
The source (🔬 CS Student)
- E. F. Codd, "A Relational Model of Data for Large Shared Data Banks" (1970). Now that you know the vocabulary, re-read Codd's original — relations, tuples, domains, and keys appear here for the first time. Remarkably clear.
- C. J. Date, Database in Depth and An Introduction to Database Systems. Date is the foremost expositor of relational theory. Database in Depth is a focused, opinionated treatment of the model itself — keys, integrity, and why the model is what it is. Excellent if you want rigor.
On NULL (everyone — this bites everyone eventually)
- C. J. Date's critiques of
NULL. Date famously argues against three-valued logic andNULLaltogether. You don't have to agree, but understanding the critique deepens your respect for how slipperyNULLis. - Tony Hoare, "Null References: The Billion Dollar Mistake" (talk). The inventor of the null reference reflects on why it was a mistake. Short, accessible, and it'll make you handle
NULLwith appropriate caution. - PostgreSQL Docs: "Comparison Functions and Operators" and the notes on
NULL. The authoritative word on howNULL,IS NULL,IS DISTINCT FROM, and three-valued logic actually behave in PostgreSQL.
Keys, in practice (💻 Developer · 🏗️ DBA)
- "Surrogate vs. natural keys" — articles and debates. This is a genuine, ongoing design debate. Read a couple of well-argued posts on each side; Case Study 1 in this chapter lands on "surrogate PK + unique natural key" for good reasons, but knowing the trade-offs makes you a better designer.
- PostgreSQL Docs: "Constraints." The complete reference on
NOT NULL,UNIQUE,CHECK, primary keys, and foreign keys (including referential actions). You'll return to this for Chapter 14.
Reference material (everyone)
- Appendix D — PostgreSQL Data Types (in this book): the practical reference for choosing domains.
- Appendix E — Relational Algebra Reference (in this book): a one-page companion to the next chapter.
- PostgreSQL Docs: "Data Types." The full catalog, when you need a type this book didn't cover.
Do, don't just read
- Run
\don all 13 Mercado tables. Read every constraint and foreign key. Try to predict, for each table, what bad data the constraints make impossible. - Deliberately break things. Try to insert duplicate emails, negative prices, ratings of 7, and orders for nonexistent customers. Watching the database refuse is the fastest way to internalize integrity.
Next: Chapter 4 — Relational Algebra, the operations beneath every query.