Review of "Database in Depth"

Author: Chris J. Date
Publisher: O'Reilly
Review by: Cosimo Streppone <cosimo@cpan.org>
Rating: ***
Date: 2005/09/21
Cover of the book

This book has made me think deeply before writing the review. A promising title like "Database in Depth" creates high hopes about its content. Maybe the title should have been swapped with the subtitle: "Relational Theory for Practitioners". Author is Chris Date. He is one of the most important guys that developed the relational databases theory.

First chapters talk about base concepts of relational model, like values, relations, relvars, types and domains.

The writing style is rigorous and theorical definitions are clear and well explained. The author builds a perfect mathematical castle, emphasizing n times (with n → ∞ and n → boredom level of the reader) that relational model is not SQL language. We are thought why and how SQL has limits, implementation flaws and different incompatible incarnations coming from the same ANSI standard.

The concepts expressed in the book are correct, but the exposition style is too much "pizzoso" (Bart Simpson's italian for "annoying"). Example:

  "Everyone knows (or should know!) that, in the relational model,
   two values can be tested for equality only if they come from the
   same domain".
We could say the same removing 20 words:
  "Two values can be compared only if they come from the same domain"
More:
  "Now I'd like to move on to a potentially more startling example.
   Refer to Figure 2-1. Relation R1 in that figure is a reduced version
   of ..."
Wasn't it better as:
  "Relation R1 in Figure 2-1 is a reduced version of ..."
We saved two rows of blah blah blah. If I were to read a novel book, I'd read "The Zen and the art of motorcycle maintenance"... The last one, taken from the entire chapter talking about tuples and relations.
  "Is this a tuple?

        .-----.----------.----------.----------.
        | SNO |  SNAME   |  STATUS  |   CITY   |
        |-----+----------+----------+----------|
        | S1  | Smith    |       20 | London   |
        '-----'----------'----------'----------'

  "Well, no, of course it isn't - it's a picture of a tuple, not
   a tuple as such [...]. As we saw in Chapter 1, there's a difference
   between a thing and a picture of a thing, [...]"
The author is Chris Date, one of the key experts about relational model theory

I have stressed enough my point... Let's proceed. One chapter is entirely dedicated to relvars (relation variables), an important concept, because every time you performed an UPDATE operation on a "table", you actually changed a relvar and not a relation, which is, by definition, immutable. The relationship between relvar and relation is the same that exists between a (programming language) variable PI and its content (3.14..., or π): you can modify value of PI but not the constant (π).

Another chapter explains the relational model algebra and its peculiar operators like extend, summarize, group, ungroup, expressions and it also talks about why ORDER BY clause is not part of relational model, and as such it is an illegal alien in SQL language.

There is also a chapter about type and database integrity constraints. The most interesting part for me is the 7th chapter, "Database Design Theory", that talks about normal forms (1-2-3NF, Boyce/Codd NF, 5NF), functional and join dependencies, orthogonality.
Here the problem is the opposite. I expected simple and detailed explanations, repeated like the basics of first chapters, and I found that many concepts are left unexplained. Unless you are already skilled on the subject, probably you will need to read this part at least 2 or 3 times.

The last chapter is entitled "What is the relational model?", in which the author summarizes all definitions. Two useful appendices about relational calculus and algebra (A) and recommended readings (B) close this book.

Conclusions

From my point of view, a controversial book.

Pros

Cons