A review by books_are_nice_and_enjoyable
SQL Cookbook: Query Solutions and Techniques for All SQL Users by Robert de Graaf, Anthony Molinaro

2.5

Not terrible, but also not particularly great.

This book is significantly longer than it needed to be in order to cover the material included and the registered page count of the book is not correct - my version of the book has 814 pages. The book is 'too long' on account of the fact that examples and query outputs take up much more space than is really needed. The authors will in most cases include 10-15 output rows in query output examples, despite 2 or 3 output (/and input!) rows being in most contexts really all that would be required in order to illustrate the specific point/example of interest. A related problem is that almost all topics in the book include coverage of a significant number of different solution structures, linked to a variety of different database engines/servers (DB2, Oracle, Microsoft SQL Server, MySQL, PostgreSQL); this is good if you want to be able to solve problem X regardless of which database engine you're using, but it also means that if you're using a specific type of database for most of your work, a lot of the coverage in this book will not actually be relevant to you.

A major takeaway from this book is that you can do much more with SQL than most people probably think you can; a problem also illustrated in the coverage, however, is that in many contexts the book also makes you ask yourself the very natural question: '...but why would you ever want to use SQL to solve this particular problem?' The authors as far as I recall never ask this question, but it seems highly relevant to me. In many contexts their solutions had me thinking, 'yes, you could solve that problem like that, but in many contexts that would be an awful waste of time and you wouldn't last long in your position if those kinds of solutions are the ones you're aiming for'.