Updates
Latest Tweet
What's New?
Check out for latest innovation, a computer based training video collection
Like this Page
SQL in a Nutshell: A Desktop Quick Reference Review by Dallas Marks
Helpful SQL guide regardless of DB vendor
I have a soft spot in my heart for O'Reilly Media. I was first introduced to O'Reilly, aka "the animal books" many years ago in college. I believe my first O'Reilly book was Unix in a Nutshell, Fourth Edition. It still occupies a space on my bookshelf. Next to it is Learning the Korn Shell (2nd Edition). Later, O'Reilly moved beyond it's traditional Unix and C into Oracle books. I really appreciated Oracle SQL*Plus: The Definitive Guide (Definitive Guides), when using SQL*Plus as a reporting tool (way back in 1995). Recently, I received a review copy of SQL in a Nutshell, Third Edition.
This is a reference books, meaning that you typically flip to the part you need at the moment as opposed to reading from cover to cover. And the book is "SQL in a Nutshell", not "mySQL in a Nutshell", "Oracle in a Nutshell", etc. So the book covers ANSI SQL2003 syntax (also known as SQL3), MySQL version 5.1, Oracle Database 11g, PostgreSQL version 8.2.1 and Microsoft SQL Server 2008. One of the changes since the second edition is a "reduced footprint", which means that Sybase Adaptive Server and IBM DB2 UDB have been dumped from the discussion. I'm not surprised about Sybase. But I was a bit puzzled why IBM DB2 was omitted, although I'm sure O'Reilly knows who their audience is.
The book is organized by topic according to the SQL3 standard as opposed to each database vendor having their own slightly redundant section. Although some might consider the first couple of chapters fluff or filler, I found them interesting, especially since my education was electrical engineering rather than computer science. Chapter one is entitled SQL History and Implementations and covers some academic database terminology, including Codd's Twelve Principles of Relational Databases. Chapter two is entitled Foundational Concepts and reviews SQL2003 basics and sets the stage for Chapter three, which is the raison d'etre for the book: the SQL Statement Command Reference.
The book concludes with Chapter four, SQL Functions. I am frequently burned by moving amongst different database platforms. Because the book is organized by function rather than vendor, it's a helpful presentation to understand which functions are common across platforms (although most have options and variations). Chapter four also includes, by vendor, all of the nonstandard functions. I began working with Oracle 7 in 1993 and assumed that everything I was learning was "standard SQL" - until I was on a SQL Server 6.5 project and wondered what happened to Oracle favorites like DECODE and NVL. Fortunately, most databases (including Oracle) now include a more unified CASE statement to use instead of DECODE. And COALESCE is a more flexible version of NVL, although I was surprised to see it is not part of the SQL standard, despite support from multiple vendors.
This book is a handy reference and much easier to carry than a stack of books for each database vendor.