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, 15 years later and in its fourth edition, this classic reference still reigns supreme as the only book written by a SQL master that teaches programmers and practitioners to become SQL masters themselves! These are not just tips and techniques; also offered are the best solutions to old and new challenges. Joe Celko conveys the way you need to think in order to get the most out of SQL programming efforts for both correctness and performance.

New to the fourth edition, Joe features new examples to reflect the ANSI/ISO Standards so anyone can use it. He also updates data element names to meet new ISO-11179 rules with the same experience-based teaching style that made the previous editions the classics they are today.


This book is intended for working SQL programmers, database administrators, database designers, database analysts, and application system developers as well as those who are developing new features for database management systems who want to know about user needs. This would include anyone working with electronic content in the relational database context but also XML. Web services, etc.

Paperback, 816 Pages

Published: October 2010

Imprint: Morgan Kaufmann

ISBN: 978-0-12-382022-8


  • "If you work with SQL in any way, shape, or form, the most recent edition of Joe Celko’s SQL for Smarties needs to be on your bookshelf!"--Data Technology Today Blog


  • Introduction

    Chapter 1: Databases versus File Systems

    Chapter 2: Transactions and Concurrency Control

    Chapter 3: Schema Level Objects

    Chapter 4: Locating Data and Special Numbers

    Chapter 5: Base Tables and Related Elements

    Chapter 6: Procedural, Semi-Procedural and Declarative Programming

    Chapter 7: Procedural Constructs

    Chapter 8: Auxiliary Tables

    Chapter 9: Normalization

    Chapter 10: Numeric Data Types

    Chapter 11: Temporal Data Types

    Chapter 12: Character Data Types

    Chapter 13: NULLs -- Missing Data in SQL

    Chapter 14: Multiple Column Data Elements

    Chapter 15: Table Operations

    Chapter 16: Comparison or Theta Operators

    Chapter 17: Valued Predicates

    Chapter 18: CASE Expressions

    Chapter 19: LIKE and SIMILAR TO Predicates

    Chapter 20: BETWEEN and OVERLAPS Predicates

    Chapter 21: The [NOT] IN() Predicate

    Chapter 22: EXISTS() Predicate

    Chapter 23: Quantified Subquery Predicates

    Chapter 24: The Simple SELECT Statement

    Chapter 25: Advanced SELECT Statements

    Chapter 26: Virtual Tables: VIEWs, Derived Tables, CTEs and MQTs

    Chapter 27: Partitioning Data in Queries

    Chapter 28: Grouping Operations

    Chapter 29: Simple Aggregate Functions

    Chapter 30: Advanced Grouping, Windowed Aggregation and OLAP in SQL

    Chapter 31: Descriptive Statistics in SQL

    Chapter 32: Sub-Sequences, Regions, Runs, Gaps, and Islands

    Chapter 33: Matrices in SQL

    Chapter 34: Set Operations

    Chapter 35: Subsets

    Chapter 36: Trees and Hierarchies in SQL

    Chapter 37: Graphs in SQL

    Chapter 38: Temporal Queries

    Chapter 39: Optimizing SQL


advert image