Joe Celko

Joe Celko's SQL for Smarties

Advanced SQL Programming

SQL for Smarties was hailed as the first book devoted explicitly to the advanced techniques needed to transform an experienced SQL programmer into an expert. Now, 10 years later and in the third edition, this classic still reigns supreme as the book written by an SQL master that teaches future SQL masters. These are not just tips and techniques; Joe also offers the best solutions to old and new challenges and conveys the way you need to think in order to get the most out of SQL programming efforts for both correctness and performance. In the third edition, Joe features new examples and updates to SQL-99, expanded sections of Query techniques, and a new section on schema design, with the same war-story teaching style that made the first and second editions of this book classics.

Working SQL programmers, including those application developers, database analysts, and others who want to pick up some advanced programming tips and techniques, and also those who are developing new features for DBMSs who want to know about users' ideas and needs.


Published: July 2005

Imprint: Morgan Kaufmann

ISBN: 978-0-12-369379-2


  • "This book is a classic, and this revision will merely solidify its position." --Rudy Limeback SQL for Smarties is a well-known and highly regarded text in the industry and a new edition of the book will be sought by database practitioners regardless of the DBMS they use. --Craig Mullins, BMC Software


  • Part I: Data Relational Model Basics Keys and uniqueness; Normalization Practical Hints for Normalization; Practical Hints for Denormalization; Encoding and scales Implementations;Generator functions Part II: DDL (Data Declaration Language)Part III: DML (Data Manipulation Language) 1. Numeric Data in SQL 2. Temporal Datatypes in SQL 3. Character Datatypes in SQL 4. Other Expressions 5. Table Operations 6. INSERT INTO Statement 7. The UPDATE Statement 8. Comparison or Theta Operators 9. Valued Predicates 10. LIKE and SIMILAR TO Predicates 11. BETWEEN and OVERLAPS Predicates 12. The [NOT] IN Predicate 13. [NOT] EXISTS() Predicate 14. Quantified Subquery Predicate 15. The Simple SELECT Statement 16. OUTER JOINs 17. Old versus New JOIN syntax 18. Bin Packing 19. VIEWs 20. TEMPORARY TABLEs 21. Partitioning Data 22. Grouping Operations 23. Aggregate Functions 24. Other Aggregate Functions 25. Auxiliary Tables 26. Statistics in SQL 27. Regions, Runs, Gaps, Sequences and Series 28. Array Structures in SQL 29. Set Operations 30. Subsets 31. Trees in SQL 32. Graphs in SQL 33. Optimizing Code


advert image