

The MySQL AB Team, MySQL Press 2004, 481 Pages
Why would anyone want to buy a book that is essentially available for free over the Internet? This is the question I found myself coming back to as I looked through the book, but firstly, let's look at the book's contents. I looked hard, and there is very little in this book that isn't available online from the MySQL Web site or in the downloadable manual.
CHAPTER OVERVIEW
The book is 481 pages, made up of seven chapters and two appendices, and provides a complete language reference for the open source and highly popular MySQL language developed by MySQL AB. The main chapters cover the information you'd expect in a Language Reference, with chapters on Language Structure, Column Types, Functions and Operators, and (by far the biggest chapter at 130 pages) SQL Statement Syntax.
The content is right up-to-date, including chapters on Spatial Extensions (introduced in 4.1), Stored Procedures and Functions (introduced in 5.0) and extended Character Set Support (significantly changed in 4.1). So, if you haven't been following recent changes, maybe this is the time to do some homework.
The main chapter on SQL Statement Syntax takes you through all of the SQL commands, with, for example, 21 pages dedicated to the SELECT statement and 14 pages of that on Subquery syntax - introduced in 4.1 - which does indeed need lots of explanation. The explanation includes the "why" of doing something as well as the "how". It is particularly good at stating in which version of MySQL a particular piece of functionality was introduced, and also gives lots of useful small hints and tips on optimisation, such as not to use HAVING for items that should occur in the WHERE clause.
STYLE POINTS
The knowledge of the authors on the subject as well as the quality of writing is another plus point for the book, and makes a refreshing change compared to some books on my shelf.
The style is identical to the Web site, meaning that, generally, the book is well written, clear, and has lots of examples dotted throughout to illustrate the points. Since a lot of work has gone into the Web site over time, the book reflects the completeness of the Web site; you don't get the feeling as with other books that it has just been thrown together at the last minute to meet a publisher's deadline.
ALL IN THE CODE
The code examples are well laid out, using a different font and capitals for user-typed SQL code - again, just like the Web site, though the book doesn't use have the use of colour that the Web site does, making the code even more readable. For the more complicated concept, the examples really help to illustrate the points.
THE LOW DOWN
Back to the original question, why buy this book? Well, the sorts of things I need to find out about MySQL in my daily development fall into several categories.
I find reading long sections of text on the screen a pain, so if I need to read up on a new subject (such as finding out how the spatial extensions work), I much prefer to read that in paper form rather than on the screen. So for me, that on its own is a fair enough reason to get the book.
Often, I just need to check some syntax. A favourite that I forget is that you use:
SHOW CREATE TABLE mydb.logs\G
but:
SHOW TABLE STATUS LIKE 'mydb.logs'\G
with the quotes - I've never quite understood why the difference.
Another example is "what is the order of the parameters to the REPLACE function?". In both these cases, the main power of the book - the index - helps a lot with the answer being quick and easy to find. You could find the similar information from the Web site, but for me, it takes a bit longer. This book has a 50-page index, and, on a number of tests that I tried on the basics it was very good at pointing to the right page.
One issue I came across recently is that if you have zero values in an index column and alter it to be AUTO_INCREMENT, the zero values get changed to new auto_increment values. I couldn't find anything about this in the book or the online Web site despite lots of "Googling". When I eventually found the answer from one of the MySQL staff, there was a mention of the issue in the online manual, (not the book, because it doesn't cover that chapter), and sufficiently obscure that I wouldn't have found the right combination of search words to find it online. (The answer by the way is that this is the default behaviour unless you set sql-mode to NO_AUTO_VALUE_ON_ZERO, ideally at startup)
A significant problem with books on a topic that is ever-changing is that they will be out of date almost as soon as they are written. In this case, much of the functionality for MySQL 5.0 has already been defined and is in the book, so it should have as much longevity as you can expect from any book on this sort of subject.
So, is it worth the cost? For me, a developer using MySQL every day, if it saves a few hours or so over its lifetime, then it is worth it.
If you are looking for new insights about the MySQL database or MySQL AB, which you won't find on their Web site or even a tutorial on how to use SQL, then this book is not for you. If, however, you want a handy reference to have on the shelf next to you, this is a useful book.
Reviewed by: Richard Nuttall


Open Source Web Development with LAMP
Derick Rethans
This book on LAMP is not primarily focused on PHP, actually quite a small part is devoted to PHP.It starts with a very brief explanation in …
MySQL Cookbook, Second Edition
Paul DuBois
A handy resource when you need quick solutions or techniques, this Cookbook addresses specific questions in using MySQL. You'll find dozens of short, focused pieces of …