Appendix H: SQL Syntax Reference

Appendix H: SQL Syntax Reference


SQL99 syntax uses BNF (Backus-Naur Form) notation to specify the standard syntax for SQL.


The notation is named after John Backus and Peter Naur, who first introduced a formal notation to describe the syntax of a given language.

The notation is quite complicated, so in this book we simplified it by using the most important elements only. In addition, because the syntaxes for our "big three" differ significantly among themselves (and also are different from the SQL99 standards), our purpose was to provide as generic notation as possible that would be applicable to them all. For additional features not mentioned in this appendix, refer to vendor-specific documentation.

The symbols used in our notation are listed in Table H-1 along with their meanings.

Table H-1: Simplified BNF Notation



< >

Encloses term names.


Separates alternatives (exclusive OR).

[ ]

Designates optional term.

{ }

Indicates at least one of the required terms is required.


Indicates term can be optionally repeated more"than once.

In addition, all SQL keywords are in uppercase letters; everything else is in lowercase.