SQL for Smarties by Joe Celko
I am a developer who uses databases rather than a DBA or SQL programmer. I was looking for a SQL book to solidfy my basic SQL skills and learn some new techines along the way. SQL for Smarties covers all of the basics and more.
The first sections of the book provide a great overview of fundamental sql techniques. I found the chapters a tad drawn out for in some regards, but newcomers may find the slow pace useful. The advanced chapters delve into very specific scenarios, few of which will be applicable during most programming careers. This is what I find most frustrating about finding the perfect sql programming book. It is impossible for any one book to cover the endless problems that programmers find themselves in. When I find myself trying to solve complex problems in sql, I step back and ask myself if a regular programming language would be better suited to express the solution.
Overall, the book is informative but does contain a slew of techniques not applicable to everyday sql programming.