Slashdot Log In
SQL Pocket Guide, Second Edition
Posted by
samzenpus
on Wed Aug 16, 2006 02:32 PM
from the all-the-answers-in-your-pocket dept.
from the all-the-answers-in-your-pocket dept.
Graeme Williams writes "So many dimensions are folded into this compact book that it took me more than a few moments to see what I was looking at. In the space of 184 pages, SQL Pocket Guide, Second Edition documents, explains, illustrates and compares the most common SQL statements from Oracle (10g), DB2 (8.2), SQL Server (2005), MySQL (5.0) and PostgreSQL (8.1), with occasional notes on previous versions, and pointers to more material on the author's web site. The book bills itself as "A Guide to SQL Usage" and it has an ample amount of explanatory material in addition to syntax and examples." Read the rest of Graeme's review.
| SQL Pocket Guide, Second Edition | |
| author | Jonathan Gennick |
| pages | viii + 184 |
| publisher | O'Reilly Media |
| rating | 10 |
| reviewer | Graeme Williams |
| ISBN | 0-596-52688-1 |
| summary | A clear and compact overview of SQL for five different databases |
The second edition of SQL Pocket Guide has been updated for the latest versions of the four databases covered in the first edition, and PostgreSQL has been added. There are also new sections on datatypes and creating tables and indexes. O'Reilly has recently announced that all of their pocket guides and references will be available as PDFs. This review is based on the paper book.
In addition to the most common SQL statements, SQL Pocket Guide, Second Edition also describes many useful functions, including datatype conversions, date/time, math, trig and string functions, and handling nulls. The table of contents for the book provides an excellent idea of what is included. One note about the table of contents: sometimes differences in syntax between different databases are covered inline, and sometimes each database is covered in a separate subsection. The table of contents makes the two types of coverage clear, since a subsection for a particular database is indicated by the database name in parentheses, such as "Numeric Conversions (Oracle)".
Rather than give formal syntax specifications, Gennick gives examples for each statement and function that he explains. The neat thing is that all the examples run against a simple schema and data which you can download from the book's web page. And yes, the data comes in five flavors to match the five databases covered by the book. You shouldn't underestimate how much this buys you in maintaining the book's high information density. It means that the SQL examples can be presented, and make sense with, little or no lead in.
Gennick also includes some pointers to the material on his web site. If you regularly lose bar bets on the details of recursive queries, or you need more explanation than the book provides, this will be very useful.
SQL Pocket Guide is organized alphabetically by topic, such as "Selecting Data", "Subqueries" or "Tables, Creating". Each topic is divided into a number of sections, such as SELECT, FROM and WHERE and again into subsections, such as specifying a table alias in the FROM clause. I like the size of the book (4 1/4 in. by 7 in.). The fact that the pages are pretty small, however, means that two facing pages might only contain a few subsections without any indication of the section they belong to. This can make it hard to keep track of context while flipping through pages. It's needlessly hard to distinguish between topic, section and subsection headings because they're all in the same font, and only a point or two different in size. There ought to be some simple way to indicate the difference.
I don't mean to suggest that the book is impenetrable. The table of contents includes both topic and section headings, and it's easy to skim to find what you're looking for. The topic is given at the bottom of every right-hand page. It would be great if the section was given at the bottom of every left-hand page, which is presently wasted by repeating the book title.
SQL Pocket Guide is small and clear. If you're looking for a book that is small, clear and complete, I'm sorry, that book doesn't exist. I'm guessing that you can't even get clear and complete. As a comparison, I took a look at an Oracle 9i reference. The whole book is over 1200 pages – the reference section, the section that is comparable in style and content to SQL Pocket Guide, is over 350 pages. The syntax diagram for the SELECT statement is terrifying just on its own.
From this syntax diagram, I discovered that Oracle has a "flashback" feature, which under certain circumstances allows you to look at the database as it was at a time in the recent past: SELECT * from EMPLOYEES AS OF (some time in the past) The problem is that the chapter on flashback queries doesn't discuss this particular syntax – here, you're on your own. As you might expect, a 1200 page book isn't an ideal learning tool, but it's not a perfect reference either. On the other hand, SQL Pocket Guide doesn't cover flashback queries at all.
SQL Pocket Guide doesn't contain every single thing anyone will ever need to know about any of the five covered databases. Different people will find different gaps in what's included. The book doesn't include creating views, which I would have found useful. Also, I recently found myself with an SQL Server table so gnarly that I used two nested unpivot statements to unwind it, but unpivot, which is new in SQL Server 2005, isn't included in the book either. The book deserves its rating, however, because it's nearly perfect for its size.
In giving up completeness, Gennick hasn't just produced a book with fewer pages, he's produced a book that works either for learning or reference. Reading the book cover to cover is a rapid and effective way to get up to speed on a particular database. This is true if you are vaguely familiar with SQL and need specific details, or if you're intimately familiar with one database but moving to another. Unless or until you've committed the details of each SQL statement to memory, this book will be the best fifteen dollars you'll spend.
You can purchase SQL Pocket Guide, Second Edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Update on the link (Score:2, Informative)
Worth buying (Score:3, Interesting)
(http://andrewman327.stumbleupon.com/ | Last Journal: Wednesday August 09 2006, @02:31PM)
If you have never coded in SQL before, this book is not for you. Instead try this excellent website [sqlzoo.net].
SQLite? (Score:3, Informative)
Why put it all in one book? (Score:3, Insightful)
(http://twoturtlelovers.blogspot.com/ | Last Journal: Friday May 25, @03:01PM)
Re:Why put it all in one book? (Score:5, Insightful)
(http://millionnumbers.com/)
90% of SQL syntax, between db's, is the same. Why get whole volumes when 90% of it would be redundant? When you finish one project using SQL Server, why by a whole new book that covers PostgreSQL?
Also, it is not uncommon to work in non-homogenous database environmnets. Different projects and programs call for different database needs.
SQL Book (Score:4, Funny)
To show the table of contents you need to SELECT * from CONTENTS order by CHAPTER;
To go to a specific chapter, say chapter 4, SELECT * from CONTENTS where CHAPTER = 4 order by PAGENUMBERS;
If you want to study one chapter, then skip to another chapter, you'll have to work with Unions and Joins to arrange for that.
If you want a timestamp and a bookmark as to what you're reading and when, you'll have to deal with a plethora of date conversion commands.
Thankfully it's a small tome, otherwise you may accidentally DROP BOOK and hurt someone.
Does it have an entry for SELECT * from BOOK WHERE SQL Like "A Pig" order by OINK;
standards compliance? (Score:2)
(http://www.devinmoore.com/ | Last Journal: Thursday May 24, @06:16AM)
books like this kinda drive me nuts, because you shouldn't need to refer to 4 different sections to get oracle vs db2 vs MSSQL, etc. "Versions" of SQL. The vast majority of the language syntax should be the same, and we should be sure to specify that. The summary infers that the differences are vast enough that you NEED different sections to understand the different flavors.
If only there was a section on Error codes... (Score:5, Interesting)
Error codes remain the one area where SQL variants have vast differences - SQLSTATE support is still pretty hit and miss - and so, while syntax portability is getting better and better, application portability remains a challenge.
Re:If only there was a section on Error codes... (Score:4, Informative)
(http://gennick.com)
SQL Pocket Guide is Cheapest at Buy.com (Score:1)
(http://www.zabada.com/)
http://www.alienegg.com/lowest-price-finder.php?u
Yep, it's a nice book. (Score:2)
(http://www.egyptiancampaign.com/)
For a pocket guide, it's great, especially with the comparison across all of the major SQL flavors (don't get me started on the Linux Pocket Guide, which is tailored to Fedora). It even makes some notices between different versions of databases (often when certain features PostgreSQL will support should appear). In short, it's nice to have the book on-hand as a paper reference--finding what I need to know is just as fast as Google. Even better that I don't have to open another browser window/tab.
One 'gripe' is that the author changed the structure of his website since the book was published, so all of the book urls are broken.
Nerdbooks (Score:3, Insightful)
I buy almost all my books from them. They have great prices and a great selection.
Rumor has it... (Score:1, Funny)
MySQL 4.1, 5.0, 5.1 & PostgreSQL 8.1.4 version (Score:3, Informative)
(http://www.plkr.org/)
Enjoy, and let me know if there's anything else we can do.
(don't forget to check out the other things we've created for you over here [nyud.net])
Re:Words a nerd will never hear (Score:2)