Review: The Art of SQL

The Art of SQLI finished reading The Art of SQL by Peter Robson. It’s a pretty informative book, and has two pretty good uses:
1) It provides author-derived benchmarks for a bunch of special cases that you might encounter in the future, such as having indexes on a single column, having it on two columns, having it on three columns, and so on. It also has pretty good explanations of how expensive things like an index can be.
2) It provides a pretty good list of common beginner mistakes, such as running a SELECT COUNT(*) on your DB just to see if the number of results is larger than zero. That is a classic example of a wasteful query, since your programming language most likely allows you to run a SELECT query without COUNT, and then perform a foreach() on the set of results, therefore eliminating this step if the number of returned rows is zero.
The book is written with Sun Tzu’s Art of War in mind, and the chapters carry the same titles as Sun Tzu’s work.