Programming Books C Java PHP Python Learn more Browse Programming Books
Have one to sell? Sell on Amazon
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

Joe Celko's SQL for Smarties: Advanced SQL Programming Second Edition (The Morgan Kaufmann Series in Data Management Systems) Paperback – October 25, 1999

ISBN-13: 978-1558605763 ISBN-10: 1558605762 Edition: 1st

13 New from $13.97 34 Used from $0.01 1 Collectible from $9.98
Amazon Price New from Used from
Paperback
"Please retry"
$13.97 $0.01

NO_CONTENT_IN_FEATURE

Shop the new tech.book(store)
New! Introducing the tech.book(store), a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Product Details

  • Series: The Morgan Kaufmann Series in Data Management Systems
  • Paperback: 550 pages
  • Publisher: Morgan Kaufmann; 1 edition (October 25, 1999)
  • Language: English
  • ISBN-10: 1558605762
  • ISBN-13: 978-1558605763
  • Product Dimensions: 9 x 7 x 1.4 inches
  • Shipping Weight: 1.9 pounds
  • Average Customer Review: 4.3 out of 5 stars  See all reviews (27 customer reviews)
  • Amazon Best Sellers Rank: #1,113,816 in Books (See Top 100 in Books)

Editorial Reviews

From the Back Cover

SQL for Smarties was hailed as the first book devoted explicitly to the advanced techniques you need to transform yourself into an expert SQL programmer. Now, in this fully updated second edition, SQL mastermind Joe Celko keeps you moving forward, using his entertaining, conversational style to teach you the best solutions to old and new challenges and to convey the way you need to think if you really want to get the most out of your SQL programming efforts.


Inside, logic- and set-based analyses replace the traditional, procedural approach to problem-solving, helping you make the conceptual leap that separates an SQL guru from the rest of the pack. As you catch on to Celko's approach, you'll devour what he has to say about some of SQL's toughest topics: how aggregate functions really work, the best way to work with NULLs, how and why to fake array structures, and much more.


This book gives special emphasis to SQL-92 and product-independent techniques that let you optimize performance or achieve highly specialized behavior, regardless of the RDBMS with which you work. If you're serious about SQL, you won't let SQL for Smarties out of your sight.


Features




  • Presents all-new war stories that give you insight into real-world SQL programming challenges.
  • Continues to cover SQL-89 but focuses heavily on the SQL-92 standard.
  • Offers still more undocumented tips for working around system deficiencies.
  • Teaches scores of advanced techniques that can be used with any product, in any SQL environment.
  • Offers expert advice from a noted SQL authority and award-winning columnist.

About the Author

Joe Celko served 10 years on ANSI/ISO SQL Standards Committee and contributed to the SQL-89 and SQL-92 Standards.

Mr. Celko is author a series of books on SQL and RDBMS for Elsevier/MKP. He is an independent consultant based in Austin, Texas.

He has written over 1200 columns in the computer trade and academic press, mostly dealing with data and databases.

Customer Reviews

4.3 out of 5 stars
5 star
15
4 star
6
3 star
5
2 star
0
1 star
1
See all 27 customer reviews
That is, I think, just the way Joe Celko try to teach SQL to us.
Brouard Frédéric
Really changing your thinking to set-based rather than procedural problem solving is what the book tries to achieve, and it succeeds.
Christopher Wanko
There are a lot of examples, but they look a little too vague to me (and as others noticed, they seem to be plagued with typoes).
Paolo Marino

Most Helpful Customer Reviews

45 of 46 people found the following review helpful By Brian Barthelt on February 14, 2000
Format: Paperback
First of all, I couldn't recommend this book for beginners. It is, however, PERFECT for the SQL programmer with some experience who is looking to take his/her SQL abilities to the next level. There are great pure SQL solutions for problems that many programmers think must be done outside of SQL in a host language. One of the most important lessons from the book is this: think in terms of sets and set theory instead of in terms of columns and rows. Lots of other great info though. Be warned: the examples are all written in the SQL-92 ANSI standard. Examples will have to be modified if your vendor-specific implementation of SQL doesn't follow the standard precisely. Kudos to Joe.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
158 of 179 people found the following review helpful By Bruce Pierson on January 11, 2002
Format: Paperback
Not so much unimpressed at Joe's knowledge, which is impressive indeed: the book reads a lot more like a teaching text than most technical books.
But there are things in here which may lead astray some who have already done things that Joe advises strongly against. I will concentrate on one example: In chapter 3 "Numeric Data in SQL", under the heading "Generator Functions" (e.g., IDENTITY, AUTO_INCREMENT) we get this doozy: "This is a horrible, nonstandard, nonrelational proprietary extension that should be avoided whenever possible". Just a statement, no reason whatsoever provided for it, because I guess he assumes we know some "math rule" or something behind why it is such a bad idea. Now, we must think for a minute why one uses such a data column. In my own case, I have a table called Parts that contains parts from several different companies. So, I guess Joe would have me make a composite primary key from PN and CompanyID. But, wait a minute, that complicates matters when I need to have a foreign key reference to the Parts table, and, oh by the way, just what is CompanyID anyway, maybe some other composite key, or some goofy "rule-based" (can you say TRIBAL KNOWLEDGE) thing? You can't seriously believe that "ALFKI" is a better key than,say, 33. What happens when I get a new customer named "Alfred Kiplinger", and have to change the "rule" that I came up with for defining the primary key? See the problem? You're not going to remember the ID anyway, because the rule will be broken at some point. I also happen to think that a part number (to give one example) should be changeable. So, I don't make PN the primary key (because you should NEVER change a PK), I simply have the database generate one for me.
Read more ›
13 Comments Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
45 of 54 people found the following review helpful By A Customer on May 27, 2001
Format: Paperback
My first problem with this book is its errors. ... there must be one on every page. There's way, way too many typos for a book like this. Half the examples won't work without corrections.
My second problem is that the book is rife with academic exercises that have little application in the real world. Code that uses cross joins will not perform well against even moderately sized data sets. Most of the examples make great magazine pieces, but fall short of anything that's actually useful in the real world.
Third, Celko likes to use syntax that has been implemented on paper only. For example, he uses set operations that no vendor has yet implemented (and probably never will since they became part of the ANSI standard years ago). A fair number of the examples in this book use code that will not run on any DBMS - even after you clean up the typos....
In sum, this book was a good idea, it's just a poor implementation. Celko needs to do some real DBA work and write from that experience. Saying "different DBMSs implement things differently - see your vendor docs" on every other page doesn't help anyone.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
18 of 20 people found the following review helpful By Fred L. Stephens on July 15, 2000
Format: Paperback Verified Purchase
I cannot work without this book. Stuck with a poor database structure and huge volumes of data, I have had to explore every trick of the trade. Few computer books in general provide information that is accurate, helpful, and not repetitive of manuals and online material that is already available to you. This book is of exceptional value. Someone swiped mine and believe me, I must have another copy. How many of the computer books you have purchased get that kind of respect?
Warning: Beginners may need another book and it is not a replacement for your SQL vendor specific reference.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
9 of 9 people found the following review helpful By Brianne Elizabeth Corbett on July 26, 2001
Format: Paperback
Joe Celko knows SQL. He may make some typos as a writer but make no mistake... this guy knows what he's talking about. He knows the language and the mechanics of the major database engines. But more importantly, he understands the logic of it all. Some of his SQL moves are simply brilliant.
I develop enterprise applications and am called upon now and then to create some very challenging SQL. Celko has bailed me out several times. I have the book as a reference source right next to my database reference manuals. He is full of ideas and often times I am looking for an idea, not a recipe.
This is a book for people who have a good knowledge of SQL. It will stimulate your thinking and programming. It isn't a book for beginners. In the right hands, SQL for Smarties will really add some sizzle to your SQL coding.
Brianne Elizabeth Corbett - IBM Global Services
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
7 of 8 people found the following review helpful By Bernard Kemp on March 12, 2001
Format: Paperback
I knew of Joe Celko from his contributions to database-related magazines and had great expectations of this work.
However, while there is much in the book that is worthwhile, I found it terribly sloppy, not only in the practical solutions supplied but in all aspects of the book. Nearly every sample piece of code, even quite short snippets, has a bug in it; the descriptions of the problems he is attempting to solve and the explanations of the solutions are full of unstated assumptions; and much of the general text is imprecise or vague and skims over areas that could do with more detailed explanations. Some parts I have read several times over without being able to make any sense of them.
In fact, I have come to the point where, if a section of text or a practical example seems wrong or difficult to follow, I don't know any more if it's Joe's fault or mine.
To Joe's credit, I can say that I have corresponded with him and he was quick to reply and was willing to continue the discussion when I followed up. He generally comes across as a "great guy", and he did accept my criticism of the solution he'd given to a problem and produced a satisfactory alternative, but every point I made to him had to be explained in detail and I still felt at the end that he wouldn't get the solution 100% right when he incorporated it in his book.
One section of the book that I found absolutely fascinating was a short description of the standardization process of the Western or Gregorian calendar. It was mostly irrelevant to the topic of the book but fascinating nonetheless. There are other gems scattered throughout, he has a good list of references and I have found he has made several points which I could quote to support my postion in arguments in standards committee meetings, but I feel that it would take as much more effort to get the book right as it has take already to produce it.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Most Recent Customer Reviews