SQL Pocket Guide by Jonathan Gennick β€” compact reference book cover with database and query theme

Pages

193

Published

2006

SQL ✨ New

SQL Pocket Guide

A Quick Reference to SQL Syntax Across Major Database Platforms

Look up the exact SQL syntax you need, for the database you're actually using, without wading through a 900-page manual.

SQL Pocket Guide is a compact, no-nonsense reference covering the SQL syntax and features you reach for every day. Written by Jonathan Gennick, it spans the major relational database platforms β€” Oracle, MySQL, SQL Server, PostgreSQL, and DB2 β€” flagging where behavior diverges so you always know what works where. At 193 pages it fits in a back pocket and answers a syntax question faster than any browser tab.

About this book

SQL is deceptively simple to start and surprisingly easy to forget. The exact syntax for a window function, the right way to cast a date, whether a particular JOIN behavior is standard or vendor-specific β€” these are the questions that interrupt your work several times a week. SQL Pocket Guide exists to answer them without ceremony.

Jonathan Gennick distills the core SQL language into a reference you can scan in seconds. The book covers SELECT, INSERT, UPDATE, DELETE, and the full range of supporting syntax: expressions, data types, constraints, transactions, subqueries, set operations, and more. Each entry is precise and direct, with just enough context to confirm you are looking at the right construct.

What makes this guide worth keeping beside your keyboard rather than bookmarking a documentation site is its cross-platform perspective. The major database engines β€” Oracle, MySQL, Microsoft SQL Server, PostgreSQL, and IBM DB2 β€” each have their own dialects, quirks, and extensions. Gennick annotates those differences throughout, so you can see at a glance whether a feature is standard SQL, specific to one engine, or handled differently across platforms. That saves real time when you are switching contexts or writing queries that need to run on more than one system.

The book is organized for lookup, not for reading from cover to cover. Topics follow a logical structure so you can navigate to the right section quickly, find what you need, and get back to work. Whether you are debugging an expression, checking the precedence rules for a complex WHERE clause, or confirming the exact syntax for a CREATE TABLE statement, the answer is a few page-turns away.

  • Complete coverage of core SQL: queries, DML, DDL, and transaction control
  • Platform notes for Oracle, MySQL, SQL Server, PostgreSQL, and DB2
  • Data types, operators, expressions, and built-in functions
  • NULL handling, join types, subqueries, and set operations
  • Constraint definitions, index syntax, and view creation

At 193 pages, SQL Pocket Guide stays out of your way. It does not teach you to think in sets or explain the relational model. It assumes you already write SQL and occasionally need the precise syntax confirmed quickly. For that job, it is as useful today as when Gennick first wrote it.

🎯 What you'll learn

  • Look up SELECT, DML, and DDL syntax for five major database platforms in seconds
  • Identify where Oracle, MySQL, SQL Server, PostgreSQL, and DB2 behave differently for the same SQL feature
  • Apply the correct data types, operators, and expressions for your specific database engine
  • Write subqueries, set operations, and window-function syntax with confidence
  • Handle NULL values correctly and understand how they affect comparisons and aggregates
  • Define tables, constraints, and indexes using standard and vendor-specific syntax
  • Control transactions with the right isolation level and savepoint syntax for your platform

πŸ‘€ Who is this book for?

  • Backend developers who write SQL regularly and want a fast, authoritative syntax reference within arm's reach
  • Data analysts who query multiple databases and need to check platform-specific behavior without opening full documentation
  • Database administrators who need a reliable lookup for DDL syntax, constraints, and transaction control across engines
  • Students who have learned SQL basics and want a concise reference to consolidate and look up what they have been taught
  • Full-stack engineers who touch SQL infrequently enough that syntax details do not stay memorized

Table of contents

  1. 01

    SQL Basics and Terminology

    Establishes the vocabulary and structure used throughout the book, covering how SQL statements are formed and how the reference entries are organized so you can navigate it efficiently.

  2. 02

    Queries and the SELECT Statement

    Covers the full SELECT syntax: column lists, aliases, DISTINCT, WHERE clauses, ORDER BY, and the rules governing how the database evaluates each clause.

  3. 03

    Joins and Subqueries

    Explains inner, outer, cross, and self joins with concrete syntax for each platform, then covers correlated and non-correlated subqueries and when to use each.

  4. 04

    Aggregation and Grouping

    Details GROUP BY, HAVING, and the standard aggregate functions β€” COUNT, SUM, AVG, MIN, MAX β€” along with notes on how each platform handles NULLs in aggregates.

  5. 05

    Data Manipulation: INSERT, UPDATE, DELETE

    Provides exact DML syntax for inserting single and multiple rows, updating with subqueries, and deleting safely, with platform differences called out for each statement.

  6. 06

    Data Definition: Tables, Constraints, and Indexes

    Covers CREATE TABLE, ALTER TABLE, DROP, column constraints, primary and foreign keys, and index creation syntax across all five database platforms.

  7. 07

    Data Types, Expressions, and Operators

    Maps the standard SQL data types to their platform equivalents, documents operator precedence, and covers type-casting and conversion functions for each engine.

  8. 08

    Built-in Functions

    Catalogs the most commonly used string, numeric, date, and NULL-handling functions, noting which are standard and which are platform extensions with equivalent alternatives.

  9. 09

    Transactions and Concurrency Control

    Explains COMMIT, ROLLBACK, SAVEPOINT, and isolation levels, with specific syntax and behavioral differences for Oracle, MySQL, SQL Server, PostgreSQL, and DB2.

Frequently asked questions

Do I need prior SQL experience to use this book?

Yes. This is a reference, not a tutorial. It assumes you already write SQL and need to confirm syntax quickly rather than learn the language from scratch.

Which database platforms does the book cover?

Oracle, MySQL, Microsoft SQL Server, PostgreSQL, and IBM DB2. Platform-specific differences are annotated throughout so you can see at a glance what applies to your engine.

Is a book from 2006 still relevant for modern SQL work?

Core SQL syntax is remarkably stable, and the constructs covered here remain valid across current versions of all five platforms. Newer features like advanced window functions introduced after 2006 are not covered.

Does the book include code examples or just syntax diagrams?

It includes concise syntax descriptions and short illustrative examples alongside each construct, optimized for quick lookup rather than worked-through tutorials.

Is this useful if I only work with one database?

Absolutely. The cross-platform notes are useful context, but each entry stands on its own for your specific platform. Many readers use it purely as a single-platform quick reference.

You might also like

πŸ“¬ Weekly Newsletter

Stay ahead of the curve

Get the best programming tutorials, data analytics tips, and tool reviews delivered to your inbox every week.

No spam. Unsubscribe anytime.