SQL-92, SQL-99 and SQL-2003
BNF Grammars in various formats
Last updated: Fri, 4-Jun-2012
SQL-92
Here is a heavily hyperlinked HTML
version of the BNF grammar for SQL-92 (ISO/IEC 9075:1992 - Database Language -
SQL).
The plain text file from which it was
automatically converted is more useful (read legible) for reading
without a browser.
SQL-99
Here is a heavily hyperlinked HTML
version of the BNF grammar for SQL-99 (ISO/IEC 9075-2:1999 - Database
Languages - SQL - Part 2: Foundation (SQL/Foundation)).
The plain text file from which it was
automatically converted is more useful (read legible) for reading
without a browser.
SQL-2003
Here is a heavily hyperlinked HTML
version of the BNF grammar for SQL-2003 (ISO/IEC 9075-2:2003 - Database
Languages - SQL - Part 2: Foundation (SQL/Foundation)).
The plain text file from which it was
automatically converted is more useful (read legible) for reading
without a browser.
Note! The file sql-2003-2.bnf contains a number of typos, which were
detected by Jean-Damien Durand, when he converted the file into a
Marpa grammar. His work
is
here. These typos were fixed by Ron Savage on 2014-12-06.
There is a separate file HTML for
the information from ISO/IEC 9075-1:2003 - Database Languages - SQL - Part
1: Framework (SQL/Framework).
It was automatically converted from the plain
text file, which is more useful (read legible) for reading without
a browser.
Also available:
SQL 2003 Core Features
SQL 2003 Non-Core Features
Informix OUTER Join Syntax
Here is an HTML explanation of the
Informix OUTER join syntax.
Conversion tools
The plain text was converted to HTML by a Perl
script which you may use if you wish.
Or, output to YACC with this Perl script.
The program also uses WEBCODE version 1.07
which you can download as a gzipped tar file. Note: The previous version of
this file was called webcode-1.3.tgz, which actually meant V 1.03.
Lastly, there is a makefile here.
Download
You can download a gzipped tar file containing the raw grammars, the
HTML versions of those grammars, and the conversion tools as the gzipped
tar file sql-bnf.tgz .
Please send feedback to Jonathan Leffler, variously:
jleffler@us.ibm.com or
jonathan.leffler@gmail.com .