Book Review: SQL and Relational Theory: How to Write Accurate SQL Code by C.J. Date

Author: FitzPublished: Jul 19, 2009 at 10:20 pm 0 comments

When I first started looking at SQL and Relational Theory: How to Write Accurate SQL Code by C.J. Date, I thought I knew a bit about SQL - how to use it, where to use it, and so on. After reading the book however, I'm now know how much I don't know about the topics of SQL and SQL theory. Reading along, I often felt like I fell down the rabbit hole in Wonderland.

Date is well known for writing An Introduction to Database Systems (Addison Wesley), which has been one of the best-selling textbooks for learning the theories behind modern database systems. And in this book for O'Reilly, he does a great job of explaining, generally with many well thought out discussions and examples, the various applications of many of the database constructs we take for granted. For example, Date takes the simple notion of scalar and non-scalar data types and expounds on them exponentially.

A scalar type is simply a type with no extra attributes, such as an Integer. So a variable of a scalar type has no visible components, just the value. But a non-scalar type is basically a relational object with a set of attributes that define it - basically any other kind of relational model object you can think of that doesn't boil down to a simple value.

Date then walks through what the basic SQL scalar types are (BOOLEAN, CHARACTER, NUMERIC, and so on) and explains how type checking and coercion works as well as collations, row and table types, and more. He makes sure to provide not only an explanation of how these various properties of SQL work, but also how to avoid some regular gotchas that may crop up. Many developers such as myself trip up on type checking in complex queries, and his suggestion to ensure that "columns with the same name are always of the same type" should help me avoid some issues by not relying on weak type conversions (i.e. an INTEGER isn't necessarily a FLOAT, even though they can be compared as numeric values).

Continued on the next page Page 1 — Page 2

Article tags

Spread the word
Bookmark and Share
Profile image for fitz

Article Author: Fitz

Brian Fitzpatrick (aka "Fitz") is a software engineer and writer living in Colorado Springs, Colorado, with his wife, two daughters, two dogs, and two cats -- trying desperately to survive the chaos!

Visit Fitz's author pageFitz's Blog

Read comments on this article, and add some feedback of your own

Article comments

Add your comment, speak your mind

Personal attacks are NOT allowed.
Please read our comment policy.
Please preview your comment.

blogcritics lists for Feb 09, 2010

fresh articles Most recent articles site-wide

fresh comments Most recent comments site-wide

most comments Most comments in 24hrs

top writers Most prolific Blogcritics for January

top commenters Most prolific Commenters in 24 hrs

Upcoming Stories from Blogcritics
  •