Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of SQL and relational theory

    SQL and relational theory

    C. J. Date · 2009

    SQL is full of difficulties and traps for the unwary. You can avoid them if you understand relational theory, but only if you know how to put that theory into practice. In this book, Chris Date explains relational theory in depth, and demonstrates through numerous examples and exercises how you can apply it to your use of SQL. This third edition has been revised, extended, and improved throughout. Topics whose treatment has been expanded include data types and domains, table comparisons, image relations, aggregate operators and summarization, view updating, and subqueries. A special feature of this edition is a new appendix on NoSQL and relational theory. Could you write an SQL query to find employees who have worked at least once in every programming department in the company? And be sure it’s correct? Why is proper column naming so important? Nulls in the database cause wrong answers. Why? What you can do about it? How can image relations help you formulate complex SQL queries? SQL supports "quantified comparisons," but they’re better avoided. Why? And how? Database theory and practice have evolved considerably since Codd first defined the relational model, back in 1969. This book draws on decades of experience to present the most up to date treatment of the material available anywhere. Anyone with a modest to advanced background in SQL can benefit from the insights it contains. The book is product independent.

    Systems & OS
    Open LibraryAmazon
    Stats for nerds
    9recommend
    17mentions
    13people
    2010–2020years
    65% recommend35% neutral

    Mentions per year

    201020122014201620182020

    What Hacker News says

    1. woolcapSep 2020
      Just about anything written by C. J. Date would be worth your while in this regard. It will give you a solid grounding in 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)

      thread
    2. dkubbAug 2020
      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 SQL in a way that adheres to the theory.

      You can think of this book as being the closest we have to "SQL: The Good Parts".

      thread
    3. grzmSep 2018
      There are 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: (https://en.wikipedia.org/wiki/SQL#Criticisms).

      [0]: https://www.goodreads.com/book/show/573821.Database_in_Depth

      [1]: https://www.goodreads.com/book/show/6219481-sql-and-relation...

      2) Most SQL systems provide a 1-to-1 mapping of tables to underlying storage structure which places limits on performance, while relations are logical and independent of the implementation. Other than indexing strategies, there hasn't been a lot of work in production systems to truly abstract storage from logical representation. They've been kind of stuck in their thinking. This second point isn't as important as the first, however, and more off-topic with respect to your question.

      thread
    4. chxFeb 2018
      Very often this is true for books as well. There is way more market for a book which starts you on an application or language. 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!).
      thread
    5. jklowdenFeb 2015
      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 intelligently.
      thread
    6. mathnodeMay 2013
      Hanging off this great comment, please anyone wanting to learn about relational databases I strongly suggest reading Database in Depth by C J Date. It's around 200 pages, you 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

      thread

    Related

    Cover of Database Design and Relational Theory
    2012–2021

    Database Design and Relational Theory

    C. J. Date
    1 recommend · 3
    Cover of An introduction to database systems
    2009–2024

    An introduction to database systems

    C. J. Date
    14 recommend · 35
    Cover of Learning SQL
    2014–2024

    Learning SQL

    Alan Beaulieu
    3 recommend · 4
    Cover of Transactional information systems
    2010–2021

    Transactional information systems

    Gerhard Weikum
    2 recommend · 5
    Cover of Database in depth
    2010–2016

    Database in depth

    C. J. Date
    4 recommend · 6
    Cover of SQL Cookbook
    2012–2020

    SQL Cookbook

    Anthony Molinaro
    7 recommend · 7
    Cover of Database systems
    2010–2026

    Database systems

    Hector Garcia-Molina
    recommend · 19
    11
    SQL Performance ExplainedMarkus Winand
    2014–2025

    SQL Performance Explained

    Markus Winand
    26 recommend · 34