Automotive Holiday Deals Up to 50% Off Select Books Shop Men's Athletic Shoes Learn more nav_sap_SWP_6M_fly_beacon Black Friday egg_2015 All-New Amazon Fire TV Subscribe & Save Gifts for Her Amazon Gift Card Offer cm15 cm15 cm15 $30 Off Amazon Echo $30 Off Fire HD 6 Kindle Cyber Monday Deals Cyber Monday Video Game Deals Outdoors Gift Guide on HTL

Customer Reviews

4.6 out of 5 stars42
Your rating(Clear)Rate this item

There was a problem filtering reviews right now. Please try again later.

46 of 47 people found the following review helpful
on July 30, 2010
I have a vast collection of SQL books. If it was published in the last 10 or so years, I probably have a copy. Some of them are very good, but there are quite a few similar-looking SQL books, with a similar purpose and a similar look-and-feel. So it takes some doing for a new SQL book to rise above the chaff... but SQL Antipatterns by Bill Karwin manages to do so.

This is not yet another book on SQL syntax or style. SQL Antipatterns is something altogether unique. The book is designed to point out the common things that SQL developers do, that they shouldn't be doing. Each chapter assists the reader in identifying, explaining, and correcting dangerous practices - or antipatterns.

If you take the time to read through this thoughtful book I'm sure you'll recognize some of the antipatterns. Some of you will have done them yourself, whereas others of you probably will have worked to undo some of them.

OK, many of you are still likely to be wondering what exactly is an antipattern is, right? Well, I'll give you one of the examples from Karwin's book -- Jaywalking. This is the first antipattern covered in the book and it is one of my favorites (err, I mean least favorites, I think). Jaywalking is when developers store comma-separated lists in a database column instead of redesigning the database structure in a normalized fashion. Karwin calls this jaywalking because both this practice and actual jaywalking on a street are acts of "avoiding an intersection." Funny...

Each antipatterns is described along with a clear explanation as to why it is a bad practice and advice on building a better solution. Other antipatterns covered in the book are named almost as intriguingly, such as Pseudokey Neat-Freak, Keyless Entry, Magic Beans, See No Evil, and Metadata Tribbles.

The book is not just for unlearning what you shouldn't be doing, it can also be helpful for learning new and improved development techniques. Reading SQL Antipatterns can help you to learn about current technology for full-text search, how to design code that is resistant to SQL injection attacks, and many other techniques for success.

The book is very well-organized into four parts grouping the antipatterns into the following categories: logical database design, physical database design, queries, and application development.

SQL Antipatterns should become a useful tool for DBAs and database programmers to help them create well-designed databases and applications... and to help us eliminate these common errors from our database implementations.
0CommentWas this review helpful to you?YesNoReport abuse
34 of 35 people found the following review helpful
on July 9, 2010
I recently got a new job and inherited a vast collection of SQL queries to maintain. Reading Karwin's book has been a tremendous help! Each chapter considers a particular design issue ("How can I store more than one value in a field?") and shows the most common, flawed method (the "antipattern"). He carefully explains the disadvantages, then usually shows several other ways to accomplish the same goal.

One of the things I like best about the book is that the analysis isn't black and white. Every methods has advantages and disadvantages, which Karwin carefully unpacks. He also reviews and clarifies relational theory as he goes: his discussion of "Null" is a masterpiece. In general, he favors solutions that don't subvert the basic principles of relational database theory.

This would not be a good book to try to learn SQL or Database theory from, but if you are just starting to get some real-world experience it is a Godsend. Highly Recommended.
0CommentWas this review helpful to you?YesNoReport abuse
10 of 10 people found the following review helpful
on August 24, 2010
I must admit that there was barely anything new to me in the book, but I have been in the field for quite a few years, dealing with many projects, so I had the "privilege" of seeing many horror stories. Still, I feel the book is valuable even for seasoned veterans. The main benefit is that the author organized and grouped the anti-patterns, each one is analyzed very well and contains some wise, unbiased suggestions. Each chapter stands on its own and can be read stand-alone.
The book is worth an extra star because it deals with problems related to both database's design and application developing; most book out there either cover one or the other.
This should be a mandatory reading for beginner DBAs and application developers, veterans may like it too, since it can help refreshing some concepts and can be used as a reference too.
0CommentWas this review helpful to you?YesNoReport abuse
11 of 12 people found the following review helpful
on March 4, 2011
"SQL Antipatterns" by Bill Karwin is a collection of 4~7 page chapters, each neatly organized into:
1) Here's something people often need to do
2) Here's the stupid solution they often come up with
3) Here's why that's a bad idea
4) Here's what you should do instead

The nice, bite-sized chapters along with the "standalone" nature of each are reminiscent of "Effective Java," another favorite.

Among other cuteness, the author refers to foreign keys that relate to multiple tables as "promiscuous"... I give extra points to anyone who can weave a little innuendo into an SQL text.
0CommentWas this review helpful to you?YesNoReport abuse
9 of 10 people found the following review helpful
on August 3, 2010
This book is very unique as far as database design and writing SQL statements. I could be called a 'cookbook' or a 'how-to' book, but its much more than that. The word 'antipatterns' means a way of doing something that is counter-productive in some form or another. So its basically of way to NOT do something. That may seem weird, but if you are aware of ways (patterns) that are ineffective, you will try to avoid those ways and be a more effectve programmer, developer, manager, etc.

There are lots of SQL and Database design books on how to do proper SQL statements but there are very few if any on showing students on what NOT to do with SQL. Its a great way to continue to learn SQL and Database design and advance your skills.

The author does an excellent job in going through all the phases of SQL antipatterns.

1. Rounding errors
2. Phamtom files
3. Index shotgun
4. fear of the unknown
5. random selection
6. spaghetti query
7. sql injection
8. magic beans
9. see no evil
10. ambiguous groups

The names may sound funny, but they are very informative and definitley worth understanding to realy be and efficient database programmer.

A great book and a must buy!
0CommentWas this review helpful to you?YesNoReport abuse
7 of 8 people found the following review helpful
on September 2, 2012
Very easy read with good format. The book was more novice than I was hoping, overall, but I found a good chapter or two.

My biggest gripe is the application development chapter. The author likely should have stayed away from this topic altogether as the book just sort of bottoms out at this point. This chapter left much to be desired as far as application development principles and anti-patterns go. It wasn't that the points were not good, they were just intern / 101 level concepts that belong in an application development book. I would have never guessed the book would end on MVC.

All that being said, this is a must read for intern - junior developers everywhere, both database and application developers alike.
0CommentWas this review helpful to you?YesNoReport abuse
6 of 7 people found the following review helpful
on October 16, 2010
I say surprisingly, because the active reader will think of numerous questions which the book never answers. I had to keep a notepad handy to jot down "but what about..." questions. This is actually a *good* thing. A book that not only teaches scripted lessons but also prompts the reader to create new ones is worth reading. As you would expect, the book assumes you know SQL, though not very much. If you can grok the basic joins and foreign keys, you'll have no trouble. I know exactly enough SQL to be a danger. I might say that if you're a serious RDBMS professional, you may not get much out of this. On the other hand, I've the victim^H^H^H^H^H^Huser of so many poorly designed "professional database solutions" that perhaps this book should be required reading. The author is not trying to "wow" you with SQL-fu. He deliberately keeps the SQL simple to clearly expose the (anti)patterns. I recognized several anti-patterns which I had learned the hard way in my own work and learned a few more to avoid.
0CommentWas this review helpful to you?YesNoReport abuse
4 of 4 people found the following review helpful
on January 11, 2013
While this book is interesting, well presented and written, and easy to understand, it doesn't cover enough ground to be the definitive SQL anti-patterns book.

In particular it just didn't cover enough ground on avoiding writing bad queries which is where a lot of anti-patterns in SQL make their way into production code.
0CommentWas this review helpful to you?YesNoReport abuse
5 of 6 people found the following review helpful
on November 18, 2010
The title only gives a partial idea about the content of the book. It is not only about SQL but also about data modeling. After all, even the best SQL expert cannot do much if the datamodel is a catastrophe.
Most of the ideas are illustrated with a relatively simple but complete example of a bug tracking application. The fact that the same sample application is used throughout makes it very easy to understand and to follow the presented concepts.

About the book organisation, there is an antipattern per chapter and each chapter follows the same structure:
- Objective (problem to solve)
- Antipattern description
- How to recognize the Antipattern (e.g. from questions raised by developers)
- Legitimate uses of the Antipattern
- Solution (a proposed better approach to solve the problem)

Every antipattern is explained in detail (there is almost nothing left to the imagination) and anyone involved in database programming or in data modeling (from novice to experienced) would easily learn how to recognize, and hopefully avoid, suboptimal 'solutions' that could create problems in the future.
0CommentWas this review helpful to you?YesNoReport abuse
2 of 2 people found the following review helpful
on September 12, 2010
Do you know why polymorphism in the database is bad? Put your hand down if you're a DBA, this is for application developers :)

SQL Antipatterns is written in a very astute fashion and manages to be easy reading without being overly didactic - no small feat for a technical book.

The book is sectioned into the short (~10 pages) chapters, one for each antipattern. Each chapter is structured as such:
- intro context, often humorous
- OBJECTIVE/PROBLEM you're trying to accomplish/solve
- Antipattern that is a common pitfall
- How to recognize that pattern
- Legitimate uses of that antipattern
- Solution (the correct one) for your original OBJECTIVE/PROBLEM

One previous reviewer mentioned that the book covers relative basics for an experienced DBA or developer. Indeed, even if you've been developing for a short period chances are you've seen and/or know of maybe half of the antipatterns in this book. But I'd like to point this out: it's been my observation that experts in any field revel in reviewing the basics, even if just for fun. And this book is fun to read, which is why I suggest this could work just as fine on the coffee table as casual reading as it can on the bookshelf as a technical reference.

My only constructive criticism is that I wish there was more content. Database good practices is a very expansive subject, and as I was reading the book I couldn't help but wish the author was "building up to the good stuff" as some other PragProg books do. This book is reasonably priced so it remains good value, but if it was $40+ I might have gave it four stars instead of five for this reason.
0CommentWas this review helpful to you?YesNoReport abuse
Customers who viewed this also viewed

SQL Cookbook (Cookbooks (O'Reilly))
SQL Cookbook (Cookbooks (O'Reilly)) by Anthony Molinaro (Paperback - December 26, 2005)

The Art of SQL
The Art of SQL by Stéphane Faroult (Paperback - March 1, 2006)

Send us feedback

How can we make Amazon Customer Reviews better for you?
Let us know here.