SQL and Relational Theory

Author: C Date
Publisher: O'Reilly, 2009
Pages: 426
ISBN: 978-0596523060
Aimed at: SQL developers
Rating: 4
Pros: Provides important insights into database theory
Cons: Not an easy read and not practically useful
Reviewed by: Mike James

This is a very strange book - especially so if you are expecting it to deal with how to write accurate SQL code as its title suggests. There is a sense in which it does discuss topics which might lead you to construct better SQL code but it is certainly not a cookbook, hints and tips or indeed about programming SQL.

[This review is of the 2009 first edition of this book. The second edition, ISBN:978-1449316402 from 2011, includes new material on recursive queries, “missing information” without nulls, new update operators, and topics such as aggregate operators, grouping and ungrouping, and view updating.]

 

Banner

 

What it is about is the theory that underpins the whole approach to database that is typified by SQL and other relational databases. If you have thought about SQL as "just another language" or relational databases as some sort of marketing idea you might be surprised to discover that the whole subject started out as an attempt to provide mathematical rigour to database theory. E.F. Codd, a mathematician working for IBM, noticed that a database consisted of tables that could be considered to be mathematical relations - hence relational database.

This book provides a good explanation of that theory and a lot of other mathematical ideas. However all of the ideas are fundamentally simple, if you have even a slight mathematical tendency, and could even be considered to be "snake oil". For example, a long discussion of using De Morgan's laws to transform logical conditions, something that isn't particularly noteworthy in other branches of programming, is perhaps over long and gives the topic too much importance. Yes, it is important and every programmer should understand it, but it's fairly trivial. You could say that this is also typical of the whole relational theory - it is important but is fundamentally trivial.

If you don't know about relational theory and the many normal forms that can be applied to a database then this is a really good book to get to grips with it all. It isn't an easy read unless you are a bit of a mathematician and some might just give up on it for that reason. But there are some far more mathematical accounts of the same ideas! Of course there are those who would point out that the theory of relational databases has done much to create inefficiency and a mismatch between what we want databases to do and how they are implemented. A mathematical theory might be beautiful and satisfying but that's not the same as it being even the slightest bit practical.

Should you read this book? If you are a SQL programmer the answer has to be yes - how else can you understand why you are doing things in the way that you are. I'm not at all certain that it will help you write more accurate SQL code, however.

 

Banner


Python Programming with Design Patterns

Author: James W. Cooper
Publisher: Addison-Wesley
Date: February 2022
Pages: 352
ISBN: 978-0137579938
Print: 0137579934
Kindle: B09D2RKQB5
Audience: Python developers
Rating: 1
Reviewer: Mike James
There was a time that design patterns were all the thing. Not so much now. But Python - does it have [ ... ]



ASP.NET Core in Action, 2nd Ed (Manning)

Author: Andrew Lock
Publisher: Manning
Date:April 2021
Pages: 832
ISBN: 978-1617298301
Print: 1617298301
Audience: Developers interested in ASP.NET
Rating: 4
Reviewer: Ian Elliot
One big book to cover the one big alternative web tech.


More Reviews

<ASIN:1449316409>

Last Updated ( Tuesday, 06 November 2012 )