Book Review: Introduction to SQL Fourth Edition

Introduction to SQL is now in its fourth edition and this time around proudly displaying a 20th anniversary edition monicker. Weighing in at a shelf worrying 1000+ pages, it aims to provide everything you need to know about SQL from both the data manipulation and database creation angles.

The author, Rick F. van der Lans is well known on the lecture circuit as well as being an author and running his own consultancy at www.r20.nl.

After the obligatory introductory sections, the bulk of the first half is taken up by the SELECT statement and how to use it. The sample database used for all examples is based around a tennis club and serves to provide clear examples of how the SELECT statement can be phrased to produce different results.

Introduction to SQL covers all the expected areas including different types of join, null handling, subqueries and all the various aggregation and grouping variants. Being fully updated, it also includes newer features such as ROLLUP and CUBE that are becoming increasingly commonly used to analyse large datasets.

Most examples consist of SQL code, resulting rows and an explanation of what happened and why. Sometimes the author provides more than one way of doing things to show the pros and cons of each and there are the occasional Q&A sections to check understanding.

The book claims to cover SQL Server, Oracle, DB2 and MySQL but I found most of the code to be generic with only a few boxouts to cover alternative syntaxes. The style is rather dry and humourless which you may or may not prefer – certainly some IT books go too far the other way these days with pages of inane chatter. No such problem here.

The next section is a fairly short discussion on manipulating data – deleting and amending. This is only reasonable though as the bulk of difficulty in these areas is getting the SELECT part right. After that it’s on to creating database objects

Table and index creation, keys, constraints and views get fairly thorough coverage although I’d have liked a little more on referential integrity. I was pleased to see a good section on stored procedures which often get ignored in SQL books unless they’re server specific titles.

Another area that was welcome was the use of embedded SQL in other languages. Many developers will be using this method of access almost exclusively so this section plus the ODBC coverage will be of great help. The book also covers transactions and multi-user issues of which the latter is especially important. There is also some examination of Dynamic SQL and the important role of cursors when working with SQL in a programming environment.

The book finishes off with 3 appendices providing a reference to SQL syntax and a bibliography. A useful bundled CDROM containing a copy of MySQL 5.07 plus WinSQL a GUI front end so you can try the examples at home.

On balance I thought this was a good title, both as a tutorial and as a reference because of its fairly exhaustive coverage of all options. If there was a bit more on database design practices and building in data integrity, it would be a great book. Whether you’re new to SQL or need a useful memory jogger and reference, Introduction to SQL would be a good choice.