SQL in a Nutshell
stoolpigeon writes "The cover of SQL in a Nutshell sports a chameleon, the little lizard well known for its ability to blend in just about anywhere. This is a great choice for the Structured Query Language. SQL has been around since the seventies, helping developers interact with the ubiquitous relational database management system. Thirty some years later, SQL grinds away in the background of just about any interactive web site and nameless other technologies. New alternatives are popping up constantly but I'm going to go out on a limb and say that SQL is going to be around for a long time. Anyone interacting with an RDBMS is in all likelihood going to need to use SQL at some point. For those who do, who also want a handy desktop reference, SQL in a Nutshell has been there for the last 9 years. The SQL language itself has not stood still over those years, and neither have the products that use SQL, and so now the book is available in a third edition." Read on for the rest of JR's review.
SQL in a Nutshell, 3rd Edition
author
Kevin Kline, Daniel Kline, Brand Hunt
pages
590
publisher
O'Reilly Media Inc.
rating
10/10
reviewer
JR Peck
ISBN
978-0-596-51884-4
summary
Covers the entire ANSI SQL2003 standard as well as how that standard is implemented
It's pretty easy to sum up what SQL in a Nutshell contains. It covers the entire ANSI SQL2003 standard as well as how that standard is implemented in MySQL 5.1, Oracle Database 11g, PostgreSQL 8.2.1 and Microsoft SQL Server 2008. There is a new ANSI standard more recent than the 2003 standard, ANSI SQL2006. This new standard does not change anything covered in the book, but introduced XML and XQuery which are not covered here. The format for conveying all this information mirrors that of the other "...in a Nutshell" books. There are four sections. The first is a very short (15 pages) history of SQL and the second is a summary of foundational concepts. The vast majority of the book is the third section, "SQL Statement Commands." These commands are given in alphabetical order. There is also a table at the very beginning of the chapter listing every command and showing how it is supported by the four platforms.
Each command is presented by starting with a short summary of what it does. This is followed by a table showing which RDBMS products support the command, the proper syntax for the command, key words, command rules, possible issues that may come up and implementation details and examples for each of the four RDBMS products represented. A couple of the differences between the second and third edition are that two RDBMS products were dropped and there are more examples. The products dropped allowed for there to be more examples while also making the book smaller than earlier editions. Anyone working with Sybase Adaptive Server or DB2 UDB will want to hold onto their second edition copy of this book if they want to have that platform specific content available, because it is not in this third edition.
The book states that the dropped platforms were the least popular of those in earlier editions. For those wondering why their favorite RDBMS is not in the list, that gives the answer. To keep length down the number of specific platforms covered was kept to four. Fortunately the books is still of high value for most readers as most decent RDBMS products will support ANSI SQL standards. On those occasions they do not, the reader would have to look to another resource for help. The length issue is easy to understand when looking at the GRANT statement and seeing that it covers over twenty pages. Most of this space is used to explain the various options available on each platform.
The last section SQL Functions documents all of the standard functions with examples and then contains a list of platform specific extensions, grouped by product. There is not a table showing platform support like there was for SQL statements. This section is much smaller, so it really isn't an issue. The single appendix that follows list standard and platform specific key words.
So who would benefit from SQL in a Nutshell? The most obvious to me is the DBA or developer working across more than one of the four platforms presented, especially if they don't move from one to the other too often. Like an Oracle DBA that needs to go do something in MS SQL Server every so often, or the same type of thing between any of the others. This makes for a quick resource that will sort out forgetting how one or the other does things rather quickly. But even if one isn't moving across multiple platforms, unless the whole standard has been memorized, this is a great help.
The second group I see gaining some real good from this book are those new to working with SQL. I've worked with all four platforms and others not covered in this book and on every single one of them I've hit error messages that were anything but helpful. Being able to go directly to a correct statement of syntax and usage is a real help when the system doesn't want to tell what is really going on. It is important to remember that this is a pure reference book. It is not written with the intent of teaching how to use SQL. That said, it covers the entire standard. Much like a dictionary can be used to increase one's knowledge of a language, reading through this reference can be a good way to learn more about SQL. Many introductory texts aren't going to cover the whole standard or as many platform specific details. The student of SQL would get a real jump by working through this book. It is compact enough that while it wouldn't be a thrilling read, it is completely doable.
Who wont like it? Probably anyone who doesn't like any of the other nutshell books from O'Reilly. This book is pretty much exactly like my Unix in a Nutshell, Linux in a Nutshell and MySQL in a Nutshell books. If the format and approach bothers you, don't look for any radical departure that will make it more palatable here. If you are like me and already know you like the format, then this is pretty much a sure thing. For the vast majority of us that work in the database world, this is the reference. I say this keeping in mind the scope of the book. Is this everything one needs to know about SQL? Obviously not. There is much more to be said about SQL as evidenced by all the words that have been said and are out there in print. But when one wants to know quickly about SQL statements and functions, I can't think of a better resource.
Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Each command is presented by starting with a short summary of what it does. This is followed by a table showing which RDBMS products support the command, the proper syntax for the command, key words, command rules, possible issues that may come up and implementation details and examples for each of the four RDBMS products represented. A couple of the differences between the second and third edition are that two RDBMS products were dropped and there are more examples. The products dropped allowed for there to be more examples while also making the book smaller than earlier editions. Anyone working with Sybase Adaptive Server or DB2 UDB will want to hold onto their second edition copy of this book if they want to have that platform specific content available, because it is not in this third edition.
The book states that the dropped platforms were the least popular of those in earlier editions. For those wondering why their favorite RDBMS is not in the list, that gives the answer. To keep length down the number of specific platforms covered was kept to four. Fortunately the books is still of high value for most readers as most decent RDBMS products will support ANSI SQL standards. On those occasions they do not, the reader would have to look to another resource for help. The length issue is easy to understand when looking at the GRANT statement and seeing that it covers over twenty pages. Most of this space is used to explain the various options available on each platform.
The last section SQL Functions documents all of the standard functions with examples and then contains a list of platform specific extensions, grouped by product. There is not a table showing platform support like there was for SQL statements. This section is much smaller, so it really isn't an issue. The single appendix that follows list standard and platform specific key words.
So who would benefit from SQL in a Nutshell? The most obvious to me is the DBA or developer working across more than one of the four platforms presented, especially if they don't move from one to the other too often. Like an Oracle DBA that needs to go do something in MS SQL Server every so often, or the same type of thing between any of the others. This makes for a quick resource that will sort out forgetting how one or the other does things rather quickly. But even if one isn't moving across multiple platforms, unless the whole standard has been memorized, this is a great help.
The second group I see gaining some real good from this book are those new to working with SQL. I've worked with all four platforms and others not covered in this book and on every single one of them I've hit error messages that were anything but helpful. Being able to go directly to a correct statement of syntax and usage is a real help when the system doesn't want to tell what is really going on. It is important to remember that this is a pure reference book. It is not written with the intent of teaching how to use SQL. That said, it covers the entire standard. Much like a dictionary can be used to increase one's knowledge of a language, reading through this reference can be a good way to learn more about SQL. Many introductory texts aren't going to cover the whole standard or as many platform specific details. The student of SQL would get a real jump by working through this book. It is compact enough that while it wouldn't be a thrilling read, it is completely doable.
Who wont like it? Probably anyone who doesn't like any of the other nutshell books from O'Reilly. This book is pretty much exactly like my Unix in a Nutshell, Linux in a Nutshell and MySQL in a Nutshell books. If the format and approach bothers you, don't look for any radical departure that will make it more palatable here. If you are like me and already know you like the format, then this is pretty much a sure thing. For the vast majority of us that work in the database world, this is the reference. I say this keeping in mind the scope of the book. Is this everything one needs to know about SQL? Obviously not. There is much more to be said about SQL as evidenced by all the words that have been said and are out there in print. But when one wants to know quickly about SQL statements and functions, I can't think of a better resource.
Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Nostra Fucking Damus.
SQL> select COUNT(*) from 'posts';
1
While I got quite some milage out of my copy of Python in a Nutshell back in the day, online documentation has much improved and I feel just as comfortable hitting a few keys to get the reference material I want as flipping through pages. O'Reilly Nutshell guides seem to me consigned to that most infamous category of tech reading printed material: the bathroom book.
the SQL to this book.
That's not SQL in a nutshell... This is SQL in a nutshell:
SQL: HELP! I'M TRAPPED IN A NUTSHELL
SQL: WHAT KIND OF SHELL HAS A NUT LIKE THIS?!?
(my 100 billion apologies, Mr. powers.)
Oracle Documention wasn't as dry as a desert. I like O'Reilly because he's not afraid to converse like a regular human being in his books. I feel like I'm being taught something rather then being shown how to do it. Would I go out and by this book? If I used SQL - definately.
...try Stephane Faroult's The Art of SQL. I've read both that and his "Refactoring SQL Applications"; I think I got a little more out of the former.
But anyhow, in both books he has a distinct and lively writing style and includes lots of anecdotes. His style kind of reminds me of Betrand Meyer... for those who have read Meyer's 1000 page tome "Object Oriented Software Construction".
The Army reading list
while the "Nutshell" books make great gifts for someone somewhat experienced in a topic, it needs to be pointed out that they're not necessarily the best option for a beginner.
Watch the Teaser Trailer for "The Lightning Thief" Her
As has been noted, it's been around for quite some time now. There was enough uncovered material remaining to justify another book?
I've always thought the books I see in people's offices are just trophies they're showing off stating "I know this language" or "I know that topic". I've actually never seen a co-worker use one of the books either. I agree with some of the other posters, that it's just easier to search Google for something.
"During My Service In The United States Congress, I Took The Initiative In Creating The Internet." -Al Gore
There are a gazillion programming languages, with new ones added every day. C, C++, Java, C#, Objective C, Pascal, Modula 3, Ada, Ocaml, Haskell, Lisp, Scheme, Python, Ruby, Perl, Lua, Javascript, etc. There's even a choice of shell scripts: sh, csh, bash, ksh, zsh, etc.
But only one SQL. I'm sure there are some other database query languages, but they are so obscure that no one but the longbeards have ever heard of them. Why is that? Why are there no alternatives to SQL? Not just minor variants, but actual alternatives.
Don't blame me, I didn't vote for either of them!
New alternatives are popping up constantly but I'm going to go out on a limb and say that SQL is going to be around for a long time.
That's pretty much guaranteed. COBOL is still around.
There absolutely are better alternatives, for almost every situation. No one in their right mind starts a new system in COBOL, when they have a choice.
Yet COBOL is still around, and will be still around for awhile. So will SQL.
The only question is whether SQL will be like COBOL or like C. I could make a similar case for C being obsolete, and there are certainly many cases where a performance penalty is well worth it to get some other desired feature -- for instance, there are things I can imagine doing in Erlang that I'd never attempt in C. But people do anyway, and even modern high level languages seem to start as interpreters written in C.
Personally, I'd rather see CouchDB mature, and see SQL become more like COBOL, but that doesn't seem likely to happen soon.
Don't thank God, thank a doctor!
Does the book cover SQL injection - how to and prevention/detection?
Actually according to both the ANSI and ISO stds, SQL has no translation from the acronym. Now before flames start, please read the standards. A friend of mine has been an active member of the ANSI committee since the early '90's, and I have presented proposals to the committee.
I find across the board the O'Reilly books are usually pretty good. There are some that are "regurgitated" manpages. Many are "gold standards" in their topic... I'd say they have more "gold standards" than any other publisher. I've seen individual books from other publishers that have very good individual authors but not consistently good across the whole lineup. I guess I feel more comfortable "buying blind" on a topic I don't know with the O'Reilly brand than any other.
That's SQL in a nutshell. I think anything more than that is a fairly detailed book.
:q!
If it were, there would not need to be vendor-specific examples in every SQL book.
Why can't people just implement standard ANSI SQL and be done with it?
I am really tired of vendors (MySQL) and their non-standard SQL. I want my JDBC applications to just work and not have special-case code for each database.
Last I checked, IBM DB2 had the biggest market share of any SQL database. (Link to 2003 Gartner Study, and I don't think the situation has changed much.)
So do DB2 users just not buy books like SQL In A Nutshell? Or have O'Reilly made a serious mistake here?
From my point of view it looks like a mistake, as I'm only interested in PostgreSQL and DB2... but then again, I work for IBM, so maybe I'm a special case?
[Opinions mine, not IBM's.]
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak