I have written a book, SQL Antipatterns: Avoiding the Pitfalls of Database Programming from Pragmatic Bookshelf, based on the most common SQL problems I have answered on Stack Overflow and other forums, mailing lists, and newsgroups over the past 15 years.