SQL-92, SQL-99 and SQL-2003
BNF Grammars in various formats
Last updated 2016-04-18

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 was converted by Jean-Damien Durand into a Marpa-style grammar (i.e. into BNF). His Perl module is on MetaCPAN.org. Click on 'Source (raw)' at the top of the LHS's vertical menu to display that BNF. See Marpa's homepage for more on Marpa.

There is a separate file 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.09 which you can download as a gzipped tar file. Lastly, there is a makefile here.

    Download

    You can download a gzipped tar file containing everything (the raw grammars, the HTML versions of those grammars, and the conversion tools) as the gzipped tar file sql-bnf-20160417.tgz.


    Please send feedback to Jonathan Leffler, variously: jleffler@us.ibm.com or jonathan.leffler@gmail.com .