BNF Grammar for ISO/IEC 9075-2:2003 - Database Language SQL (SQL-2003) SQL/Foundation
=====================================================================================
@(#)$Id: sql-2003-2.bnf,v 1.11 2005/07/13 18:37:30 jleffler Exp $
--p
Information taken from the Final Committee Draft (FCD) of ISO/IEC 9075-2:2003.
However, the page numbers and some section titles (9.14 through 9.23,
for example) are from the final standard.
This means there could be other as yet undiagnosed differences between
the final standard and the notation in this document; you were warned!
--/p
--p
The plain text version of this grammar is
--## sql-2003-2.bnf .
--/p
--hr
--h2 Key SQL Statements and Fragments
--/h2
--bl
--li ALTER DOMAIN
--li ALTER TABLE
--li CLOSE cursor
--li Column definition
--li COMMIT WORK
--li CONNECT
--li CREATE ASSERTION
--li CREATE CHARACTER SET
--li CREATE COLLATION
--li CREATE DOMAIN
--li CREATE FUNCTION
--li CREATE PROCEDURE
--li CREATE SCHEMA
--li CREATE TABLE
--li CREATE TRANSLATION
--li CREATE TRIGGER
--li CREATE VIEW
--li Data type
--li DEALLOCATE PREPARE
--li DECLARE cursor
--li DECLARE LOCAL TEMPORARY TABLE
--li DELETE
--li DESCRIBE
--li DESCRIPTOR statements
--li DISCONNECT
--li EXECUTE
--li EXECUTE IMMEDIATE
--li FETCH cursor
--li FROM clause
--li GET DIAGNOSTICS
--li GRANT
--li GROUP BY clause
--li HAVING clause
--li INSERT
--li Literals
--li Keywords
--li MERGE
--li OPEN cursor
--li ORDER BY clause
--li PREPARE
--li REVOKE
--li ROLLBACK WORK
--li SAVEPOINT
--li Search condition
--li SELECT
--li SET CATALOG
--li SET CONNECTION
--li SET CONSTRAINTS
--li SET NAMES
--li SET SCHEMA
--li SET SESSION AUTHORIZATION
--li SET TIME ZONE
--li SET TRANSACTION
--li SQL Client MODULE
--li UPDATE
--li Value expression
--li WHERE clause
--/bl
--hr
--h2 5 Lexical Elements
--/h2
--p
Basic definitions of characters used, tokens, symbols, etc.
Most of this section would normally be handled within the lexical
analyzer rather than in the grammar proper.
Further, the original document does not quote the various single
characters, which makes it hard to process automatically.
--/p
--h3 5.1 (p151)
--/h3
::= ::= | | ::= | ::=
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
::=
a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z
::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
::=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ::= !! See the Syntax Rules
::= "
::= %
::= &
::= '
::= (
::= )
::= *
::= +
::= ,
::= -
::= .
::= /
::= :
::= ;
::= <
::= =
::= >
::= ?
--p
--i
The trigraphs are new in SQL-2003.
--/i
--/p
::= | ::= | ::= [
::= ??(
::= ]
::= ??)
::= ^
::= _
::= |
::= {
::= }
--hr
--h3 5.2 and (p134)
--/h3
--p
Specifying lexical units (tokens and separators) that participate in SQL language.
--/p
::= | ::=
|
|
|
|
|
|
| ::= ::= [ ... ]
::= |
--p
--i
--small
Previous standard said:
--br
::= |
--/small
--/i
--/p
::= !! See the Syntax Rules
::= !! See the Syntax Rules
::= ... ::= K | M | G
--p
--i
--small
The productions for and so on are new in SQL-2003.
--/small
--/i
--/p
::=
U...
[ ESCAPE ]
::= ...
::= | ::= | ::= ::= ::= !! See the Syntax Rules
::= !! See the Syntax Rules
--p
--i
--small
The rule for in the standard uses two adjacent literal double quotes rather than referencing ; the reasons are not clear.
It is annotated '!! two consecutive double quote characters'.
--/small
--/i
--/p
::= ::=
|
|