SQL in a Nutshell 2nd Edition
Home Tutorials Reviews Weblog

Review: SQL in a Nutshell 2Edition by Kevin Kline at OReilly Press
Feature: This is one of those reference texts that is so right for the times
nutsThe whole problem with the ANSI SQL standard is nobody adhered to it. ANSI SQL has sort of acted as desirable target that everybody could agree upon .... and nudge, nudge.. wink, wink.. know what I mean, know what I mean ... nobody comes close to complying with it. In fact at various times SQL standards have come with several levels which then provided database vendors with even more wiggle room. The net results is for all to be seen within SQL in a Nutshell.

Kevin Kline has done the community a great favor by listing in detail the latest SQL2003 standard before each major command group - so readers know what the standards are and then can see immediately which is most standards compliant among the five databases covered in this book: IBM DB2 v8.1, MySQL AB's MySQL 4.0, Oracle's Oracle 10g, Postgres PostgreSQL, SQL Server 2000. And the verdict is clear from the table of comparisons of major commands on pages 59-60 in the book - the database vendors are only loosely compliant with the SQL2003 standard. And if you went back to SQL92, the picture remains the same. The database vendors make Microsoft's IE browser look good.

By the way, this one version behind is the only drawback to this circa 2004 book. The versions of the databases are one generation back - IBM DB2(8.1 is covered) is at Viper v9.1 and the beta of Viper 2 has already appeared, MySQL(4.0 is covered) is at 5.1 and 5.2 Falcon is solidly in beta, Oracle (10g is covered) has just introduced 11g, PostgreSQL(7.2 is covered) has moved to 8.1 and SQL Server(200 is covered) is at 2005 and 2008 version is between alpha and beta.

But there is an advantage to being a generation behind in databases because many shops are also running one or two generations behind the latest and greatest. So many shops are still DB2 8.x or Oracle 10g making SQL in a Nutshell correspond well to what is actually in the field. Finally, 85-95% of the core syntax of the databases remains the same even with a major upgrade like DB2 Viper or MySQL 5.x. There are some deprecations and out right deletions or changes in command syntax; but the bulk of syntax changes are new and added to the databases' command repertoire.

The Issue of Standards Compliance

By writing SQL in a Nutshell with the SQL2003 standard as the model, Kevin Kline raises the issue that is confronting the database community. On one hand there is an absolute flood of data just about swamping IT shops at every level from operations, government compliance, BI based short term adjustment through to longer term forecasting and strategic planning. Next there is more need for data exchanges between systems because much tighter supply chains, greater online activity and the new realities imposed by mergers and acquisitions.

On the other hand, the major SQL databases are sufficiently different in command syntax and underlying database design and structure such that cross database joins, queries and updates are the rare exception of the most savvy of shops. True IBM has its Cross database Query Integration tool and Oracle, with the purchase of Sunopsis, has much stronger cross databases tools. But in general, cross SQL database operations are bleeding edge - often requiring complex temporary table creation and/or ETL replications. Hence continuing IT Silos of information.

So having a book like SQL in a Nutshell with its comprehensive coverage of the variations in syntax among SQL database vendors is vital for application developers that have to suddenly marry up MYQL with Oracle or SQL Server and DB2. This book gives users a dimension on not just the queries and updates but also the support and administration.

What's in the Book

I was surprised to see SQL in a Nutshell 2ed had grown from about 200 pages in the first version to nearly 700 pages now. But this is necessary because DB2 and full SQL2003 standard syntax and semantics are now covered. As well Kevin spends more time on the SQL background and history in chapter 1. This puts the background in perspective which then helps one understand the second chapter's foundational concepts on operators and datatypes among the different SQL's. This is vital reading for any cross database usage.

The bulk of the book is in chapter 3, SQL Statements. This is organized in alphabetic order mixing DML-Data manipulation commands with DDL- Data Definition and DCL-Data Control Language commands altogether. So then one understands why the index at 45 pages is so large - that is the first place to go to find a specific SQL command. Also as noted, SQL in a Nutshell gives comprehensive coverage of the syntax of each command in SQL 2003 syntax. This is followed by DB2 syntax and semantics for the same command - and in similar fashion, all the details for MySQL, Oracle, PostgreSQL, and SQL Server. Each of the statements for each database has complete syntax, 1 or2 examples and often a special tip or warning caution.

This same format is adopted for the database functions supplied by all the vendors. Too often users do not realize that the Select query power of databases is wrapped as much in the functions enabled as joins, special ops and subqueries allowed. But just as in the DML, there are over 110 pages devoted to SQL functions and their differences and variants from the database vendors. This has quickly become the most dog-eared section of my copy of SQL in a Nutshell.

Finally, Kevin Kline has added much more meat to a vital section - databased programming. Here he covers such topics as ODBC, JDBC, ADO.NET and the integration of databases with programming languages such as C/C++, Java and even some of the popular scripting languages. In sum, reference text prove their value by the battering they take. SQL in a Nutshell first edition has certainly won that badge of honor many times over. I know the 2nd edition is fast earning top battering marks. If you are into database, particularly cross platform database this tome will save a ton of time.
Top of Page  Home  Tutorials 

Developers Weblog  Graphics Reviews and Tips