Introduction

This book is an attempt to cram the most useful information about SQL into a pocket-size guide. It covers commonly used syntax for the following platforms: IBM DB2 Release 9.7, MySQL 5.1, Oracle Database 11g Release 2, PostgreSQL 9.0, and Microsoft SQL Server 2008 Release 2.

Not all syntax will work on all platforms, and some features may not be available in earlier releases of these products. Whenever possible, I’ve tried to note any product or release dependencies.

Organization of This Book

Topics are organized alphabetically, with many section names carefully chosen to correspond to relevant SQL keywords. For example, see Inserting Data for help with the INSERT statement.

Platform notes

MySQL requires the leading parenthesis in a function invocation to immediately follow the function name. For example, upper (name) will generate an error message because of the space between upper and (name).

Conventions

The following typographical conventions are used in this book:

UPPERCASE

Indicates an SQL keyword

lowercase

Indicates a user-defined item in an SQL statement

Italic

Indicates emphasis or a new technical term

Constant width

Used for code examples and for in-text references to table names, column names, expressions, and so forth

Constant width bold

Indicates user input in input/output code examples

Constant width italic

Indicates an element of syntax you need to supply

[]

Denotes an optional element of syntax

{}

Denotes a required choice

|

Separates choices in syntax

Example Data

All example ...

Get SQL Pocket Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.