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.
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.
The plain text was converted to HTML by the Perl script bnf2html which you may use if you wish. The bnf2html script also uses the C program WEBCODE version 1.09 which you can download as a gzipped tar file.
See also bnf2yacc , an experimental script to convert BNF into an outline Yacc grammar. The generated grammar typically includes some unacceptable tokens, such as %token 0, that should be handled by the lexical analyzer rather than the grammar. The SQL standard includes such rules as grammar rules.
(The Perl scripts should normally be renamed after downloading.)
Last modified: 13th November 2017