
SQL and relational theory
by C. J. Date · first published 2009
17mentions
9recommended by
13HN commenters
2010–2020first – last mentioned
69% recommend31% neutral
Why HN recommends it
Explains how SQL maps to the relational model, giving working developers the theory behind queries, design and correctness; one commenter says it changed how they write SQL after a decade of use.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.





…at least two aspects of this: 1) SQL is not entirely faithful to the underlying logical principles of the relational model. Chris Date's "Database in Depth: Relational Theory for Practitioners"[0] or "SQL and Relational Theory: How to Write Accurate SQL Code"[1] are good texts that go into this in detail. There's plenty of stuff online if you search for it. For a very brief example of criticisms, you can take a look at Wikipedia:…
on “A Relational Model of Data for Large Shared Data Banks (1970) [pdf]” ↗I would recommend SQL and Relational Theory by CJ Date. It completely changed how I use SQL. Before reading it, I had about a decade of experience with SQL. I didn't really understand the theory underneath. I also didn't understand how to write…
on “Ask HN: Self-taught webdev with lots of free time. What should I learn?” ↗…theory. so i don't understand why people are talking about regexps - that should be covered in a subsection (regular grammars) of one chapter of that book. anyway, for databases i would suggest date's "sql and relational theory" - it shows how sql is related to a more elegant, cleaner, underlying theoretical approach and will get you to think in more declarative terms. for general programming, sicp is worth reading if you haven't…
on “Ask HN: Fundamental texts for serious web engineers?” ↗…will learn a lot about the relational model, database/query/index design in a short amount of time, with a little bit of logic thrown in there too. Just need a good SQL reference? 'The Art of SQL' or 'SQL and Relational Theory' Are you not entertained? Fine, choke on this : http://en.wikipedia.org/wiki/The_Third_Manifesto
on “Most data isn’t “big,” and businesses are wasting money pretending it is” ↗…Learning SQL is a really excellent intro, and probably covers the majority of what your average developer is going to ever need to know about SQL ( http://shop.oreilly.com/product/9780596520847.do ) SQL and Relational Theory gives you more background on relational theory - basically gives a more academic background for existing practitioners of SQL. Date is pretty dry author with a few hangups, but it's largely good solid…
on “Save 50% on all oreilly's ebooks and videos (today only)” ↗…comment about Date being reluctant to analyze the matter, unfortunately his work is disseminated in a lot of books (and he changed his position on quite several matters throughout the years). I love the "SQL and Relational Theory" one but, having red all of his books, I would be hesitant to suggest it unless one already knows Date. I think the latest edition (8th) of "An Introduction to Database Systems" is still the best book…
on “OrmHate” ↗…But if you are very deeply into a topic, getting to the next level won't be a book. It'll be blog posts, Stackoverflow, blood, sweat and tears. I haven't bought a book since the 3rd ed of Chris Date: SQL and Relational Theory (but that's a very useful book!).
on “Ask HN: Why is there so little programming related content on HN?” ↗I can't see the comments on that site (maybe adblock is killing them?), so this may be a duplicate, but I would suggest reading Date's "SQL and Relational Theory" and looking at Tutorial D (an alternative to SQL) before implementing this. At the very least it would clarify how you might use sets and where you need to worry about things like ordering if you are…
on “Awesome new SQL syntax - for developers” ↗I do not buy computer books often. I have the Internet :) there are exceptions, of course. One such is SQL and Relational Theory. Not your "learn this in 24hrs" book, that's for sure. More my size, so to speak. Imagine my delight when on Jan 20 I find an email about how I get a 40-50% discount on the 2nd edition for buying the…
on “A+ for O'Reilly Customer Service: Keep the books and donate them” ↗I like Date's SQL and Relational Theory (http://shop.oreilly.com/product/0636920022879.do). It won't tell you about the latest changes to the standard, but it will help you get a handle on the relational model, which is the key to using SQL…
on “Modern SQL in PostgreSQL” ↗…the relational model, which you can then apply to any RDBMS. Here's a good list to start with: - Database in Depth, O'Reily (2005) - Relational Theory for Computer Professionals, O'Reilly (2013) - SQL and Relational Theory, 3rd Ed, O'Reily (2015) - Database Design and Relational Theory, 2nd Ed, Apress (2019)
on “Old, Good Database Design” ↗The correct pronunciation as stated in the standard is "ess que ell". I can't quote the ISO standard because it doesn't seem to be freely available, but I'm quoting C. J. Date from his book SQL and Relational Theory: In particular, I follow the standard in assuming the pronunciation "ess cue ell", not "sequel" (though this latter is common in the field), thereby saying things like an SQL table, not a SQL table.…
C. J. Date is a very well known technical writer. He has written extensively about SQL and relational theory.
on “A Curated Guide to PostgreSQL” ↗…associations in RoR [3]). I'm now happy just to see someone aware of why constraints might be useful, let alone being able to discuss 2 vs 3 or 4 valued logic or the usefulness of prenex normal form. [1] SQL and Relational Theory, C. J. Date 2011 [2] http://www-bcf.usc.edu/~gareth/ISL/ [3] http://stackoverflow.com/questions/922184/why-can-you-not-ha...
on “Ask HN: My son wants to make side money programming” ↗Indeed. When do you think SQL and Relational Theory will be outdated? And, do you think you can learn that from a wiki or a blog?
on “Tim O'Reilly: How I Failed” ↗