BNF Grammar for ISO/IEC 9075-1:2003 SQL/Foundation - Database Language SQL (SQL-2003)

 
Cross-Reference: rules
Cross-Reference: keywords

Derived from file sql-2003-1.bnf version 1.4 dated 2017/11/14 06:53:22
Generated on 2017-11-14 06:53:25+00:00 by file bnf2html.pl version 3.16 dated 2017/11/14 06:53:22

Information taken from the Final Committee Draft (FCD) of ISO/IEC 9075-1:2003.

The plain text version of this grammar is sql-2003-1.bnf .


Identifying the version of SQL in use

This material (starting with <SQL object identifier>) is defined in section 6.3 "Object Identifier for Database Language SQL" of ISO/IEC 9075-1:1999 (SQL Framework). It is used to express the capabilities of an implementation. The package names are identifiers such as 'PKG001', equivalent to 'Enhanced datetime facilities', as defined in the informative Annex B to SQL Framework. Each such package identifies a number of features that are provided when the SQL object identifier claims to provide the package.

Top


6.3 Object identifier for Database Language SQL

<SQL object identifier>    ::=   <SQL provenance> <SQL variant>

<SQL provenance>    ::=   <arc1> <arc2> <arc3>

<arc1>    ::=   iso | 1 | iso <left paren> 1 <right paren>

<arc2>    ::=   standard | 0 | standard <left paren> 0 <right paren>

<arc3>    ::=  9075

<SQL variant>    ::=   <SQL edition> <SQL conformance>

<SQL edition>    ::=   <1987> | <1989> | <1992> | <1999> | <2003>

<1987>    ::=   0 | edition1987 <left paren> 0 <right paren>

<1989>    ::=   <1989 base> <1989 package>

<1989 base>    ::=   1 | edition1989 <left paren> 1 <right paren>

<1989 package>    ::=   <integrity no> | <integrity yes>

<integrity no>    ::=   0 | IntegrityNo <left paren> 0 <right paren>

<integrity yes>    ::=   1 | IntegrityYes <left paren> 1 <right paren>

<1992>    ::=   2 | edition1992 <left paren> 2 <right paren>

<SQL conformance>    ::=   <level> <bindings> <parts> <packages>

<level>    ::=   <low> | <intermediate> | <high>

<low>    ::=   0 | Low <left paren> 0 <right paren>

<intermediate>    ::=   1 | Intermediate <left paren> 1 <right paren>

<high>    ::=   2 | High <left paren> 2 <right paren>

<1999>    ::=   3 | edition1999 <left paren> 3 <right paren>

<2003>    ::=   4 | edition2003 <left paren> 4 <right paren>

<bindings>    ::=   <module> <embedded> <direct> <invoked routine languages>

<module>    ::=   <module no> | <module languages> ...

<module languages>    ::=
         <module Ada>
     |     <module C>
     |     <module COBOL>
     |     <module Fortran>
     |     <module MUMPS>
     |     <module Pascal>
     |     <module PL/I>

<module Ada>    ::=
         1 | moduleAda <left paren> 1 <right paren>

<module C>    ::=
         2 | moduleC <left paren> 2 <right paren>

<module COBOL>    ::=
         3 | moduleCOBOL <left paren> 3 <right paren>

<module Fortran>    ::=
         4 | moduleFortran <left paren> 4 <right paren>

<module MUMPS>    ::=
         5 | moduleMUMPS <left paren> 5 <right paren>

<module Pascal>    ::=
         6 | modulePascal <left paren> 6 <right paren>

<module PL/I>    ::=
         7 | modulePLI <left paren> 7 <right paren>

<embedded>    ::=   <embedded no> | <embedded languages> ...

<embedded languages>    ::=
         <embedded Ada>
     |     <embedded C>
     |     <embedded COBOL>
     |     <embedded Fortran>
     |     <embedded MUMPS>
     |     <embedded Pascal>
     |     <embedded PL/I>

<embedded Ada>    ::=
         1 | embeddedAda <left paren> 1 <right paren>

<embedded C>    ::=
         2 | embeddedC <left paren> 2 <right paren>

<embedded COBOL>    ::=
         3 | embeddedCOBOL <left paren> 3 <right paren>

<embedded Fortran>    ::=
         4 | embeddedFortran <left paren> 4 <right paren>

<embedded MUMPS>    ::=
         5 | embeddedMUMPS <left paren> 5 <right paren>

<embedded Pascal>    ::=
         6 | embeddedPascal <left paren> 6 <right paren>

<embedded PL/I>    ::=
         7 | embeddedPLI <left paren> 7 <right paren>

<direct>    ::=   <direct yes> | <direct no>

<direct yes>    ::=
         1 | directyes <left paren> 1 <right paren>

<direct no>    ::=
         0 | directno <left paren> 0 <right paren>

<invoked routine languages>    ::=
         <invoked Ada>
     |     <invoked C>
     |     <invoked COBOL>
     |     <invoked Fortran>
     |     <invoked MUMPS>
     |     <invoked Pascal>
     |     <invoked PL/I>

<invoked Ada>    ::=
         1 | invokedAda <left paren> 1 <right paren>

<invoked C>    ::=
         2 | invokedC <left paren> 2 <right paren>

<invoked COBOL>    ::=
         3 | invokedCOBOL <left paren> 3 <right paren>

<invoked Fortran>    ::=
         4 | invokedFortran <left paren> 4 <right paren>

<invoked MUMPS>    ::=
         5 | invokedMUMPS <left paren> 5 <right paren>

<invoked Pascal>    ::=
         6 | invokedPascal <left paren> 6 <right paren>

<invoked PL/I>    ::=
         7 | invokedPLI <left paren> 7 <right paren>

<parts>    ::=
         <Part 3> <Part 4> <Part 7> <Part 9> <Part 10> <Part 11>

<Part n>    ::=   <Part n no> | <Part n yes>

<Part n no>    ::=   0 | Part-nNo <left paren> 0 <right paren>

<Part n yes>    ::=   !! as specified in ISO/IEC 9075-n

<packages>    ::=   <Package PKGi> ...

<Package PKGi>    ::=
         <Package PKGiYes>
     |     <Package PKGiNo>

Top


Annex B (informative) SQL Packages:

1 PKG001 Enhanced datetime facilities
2 PKG002 Enhanced integrity management
3 PKG004 PSM
4 PKG005 CLI
5 PKG006 Basic object support
6 PKG007 Enhanced object support
7 PKG008 Active database
8 PKG009 SQL/MM support
9 PKG010 OLAP

Top


B.1 Enhanced datetime facilities

The package called "Enhanced datetime facilities" comprises the following features of the SQL language as specified in the SQL Feature Taxonomy Annex of the various parts of ISO/IEC 9075.

Feature F052 Intervals and datetime arithmetic
Feature F411 Time zone specification
Feature F555 Enhanced seconds precision

Top


B.2 Enhanced integrity management

The package called "Enhanced integrity management" comprises the following features of the SQL language as specified in the SQL Feature Taxonomy Annex of the various parts of ISO/IEC 9075.

Feature F191 Referential delete actions
Feature F521 Assertions
Feature F701 Referential update actions
Feature F491 Constraint management
Feature F671 Subqueries in CHECK constraints
Feature T201 Comparable data types for referential constraints
Feature T211 Basic trigger capability
Feature T212 Enhanced trigger capability
Feature T191 Referential action RESTRICT

Top


B.3 PSM

The package called "PSM" comprises the following features of the SQL language as specified in the SQL Feature Taxonomy Annex of the various parts of ISO/IEC 9075.

Feature T322 Overloading of SQL-invoked functions and SQL-invoked procedures
Feature P001 Stored modules
Feature P002 Computational completeness
Feature P003 Information Schema views

Top


B.4 CLI

The package called "CLI" comprises the following features of the SQL language as specified in the SQL Feature Taxonomy Annex of the various parts of ISO/IEC 9075.

Feature C011 SQL/CLI
Feature C021 Automatic population of Implementation Parameter Descriptor
Feature C041 Information Schema data controlled by current privileges
Feature C051 GetData extensions
Feature C061 GetParamData extensions
Feature C071 Scroll Concurrency
Feature C081 Read-only data source

Top


B.5 Basic object support

The package called "basic object support" comprises the following features of the SQL language as specified in the SQL Feature Taxonomy Annex of the various parts of ISO/IEC 9075.

Feature S023 Basic structured types
Feature S041 Basic reference types
Feature S051 Create table of type
Feature S151 Type predicate
Feature T041 Basic LOB data type support

Top


B.6 Enhanced object support

The package called "enhanced object support" comprises all of the features of the package called (Basic object support), plus the following features of the SQL language as specified in the SQL Feature Taxonomy Annex of the various parts of ISO/IEC 9075.

Feature S024 Enhanced structured types
Feature S043 Enhanced reference types
Feature S071 SQL-paths in function and type name resolution
Feature S081 Subtables
Feature S111 ONLY in query expressions
Feature S161 Subtype treatment
Feature S211 User-defined cast functions
Feature S231 Structured type locators
Feature S241 Transform functions

Top


B.7 Active database

The package called "Active database" comprises the following features of the SQL language as specified in the SQL Feature Taxonomy Annex of the various parts of ISO/IEC 9075.

Feature T211 Basic trigger capability

Top


B.8 OLAP

The package called "OLAP" comprises the following features of the SQL language as specified in the SQL Feature Taxonomy Annex of the various parts of ISO/IEC 9075.

Feature T431 Extended grouping capabilities
Feature T611 Elementary OLAP operators

Top


END OF SQL-2003-1 GRAMMAR

Top




Cross-Reference Table: Rules

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
Rule (non-terminal) Rules using it
1987 <SQL edition>
1989 <SQL edition>
1989 base <1989>
1989 package <1989>
1992 <SQL edition>
1999 <SQL edition>
2003 <SQL edition>
arc1 <SQL provenance>
arc2 <SQL provenance>
arc3 <SQL provenance>
bindings <SQL conformance>
direct <bindings>
direct no <direct>
direct yes <direct>
embedded <bindings>
embedded Ada <embedded languages>
embedded C <embedded languages>
embedded COBOL <embedded languages>
embedded Fortran <embedded languages>
embedded languages <embedded>
embedded MUMPS <embedded languages>
embedded no <embedded>
embedded Pascal <embedded languages>
embedded PL/I <embedded languages>
high <level>
integrity no <1989 package>
integrity yes <1989 package>
intermediate <level>
invoked Ada <invoked routine languages>
invoked C <invoked routine languages>
invoked COBOL <invoked routine languages>
invoked Fortran <invoked routine languages>
invoked MUMPS <invoked routine languages>
invoked Pascal <invoked routine languages>
invoked PL/I <invoked routine languages>
invoked routine languages <bindings>
left paren <1987> <1989 base> <1992> <1999> <2003> <arc1> <arc2> <direct no> <direct yes> <embedded Ada> <embedded C> <embedded COBOL> <embedded Fortran> <embedded MUMPS> <embedded Pascal> <embedded PL/I> <high> <integrity no> <integrity yes> <intermediate> <invoked Ada> <invoked C> <invoked COBOL> <invoked Fortran> <invoked MUMPS> <invoked Pascal> <invoked PL/I> <low> <module Ada> <module C> <module COBOL> <module Fortran> <module MUMPS> <module Pascal> <module PL/I> <Part n no>
level <SQL conformance>
low <level>
module <bindings>
module Ada <module languages>
module C <module languages>
module COBOL <module languages>
module Fortran <module languages>
module languages <module>
module MUMPS <module languages>
module no <module>
module Pascal <module languages>
module PL/I <module languages>
Package PKGi <packages>
Package PKGiNo <Package PKGi>
Package PKGiYes <Package PKGi>
packages <SQL conformance>
Part 10 <parts>
Part 11 <parts>
Part 3 <parts>
Part 4 <parts>
Part 7 <parts>
Part 9 <parts>
Part n no <Part n>
Part n yes <Part n>
parts <SQL conformance>
right paren <1987> <1989 base> <1992> <1999> <2003> <arc1> <arc2> <direct no> <direct yes> <embedded Ada> <embedded C> <embedded COBOL> <embedded Fortran> <embedded MUMPS> <embedded Pascal> <embedded PL/I> <high> <integrity no> <integrity yes> <intermediate> <invoked Ada> <invoked C> <invoked COBOL> <invoked Fortran> <invoked MUMPS> <invoked Pascal> <invoked PL/I> <low> <module Ada> <module C> <module COBOL> <module Fortran> <module MUMPS> <module Pascal> <module PL/I> <Part n no>
SQL conformance <SQL variant>
SQL edition <SQL variant>
SQL provenance <SQL object identifier>
SQL variant <SQL object identifier>

Top


Cross-Reference Table: Keywords

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
Keyword Rules using it
directno <direct no>
directyes <direct yes>
edition1987 <1987>
edition1989 <1989 base>
edition1992 <1992>
edition1999 <1999>
edition2003 <2003>
embeddedAda <embedded Ada>
embeddedC <embedded C>
embeddedCOBOL <embedded COBOL>
embeddedFortran <embedded Fortran>
embeddedMUMPS <embedded MUMPS>
embeddedPascal <embedded Pascal>
embeddedPLI <embedded PL/I>
High <high>
IntegrityNo <integrity no>
IntegrityYes <integrity yes>
Intermediate <intermediate>
invokedAda <invoked Ada>
invokedC <invoked C>
invokedCOBOL <invoked COBOL>
invokedFortran <invoked Fortran>
invokedMUMPS <invoked MUMPS>
invokedPascal <invoked Pascal>
invokedPLI <invoked PL/I>
iso <arc1>
Low <low>
moduleAda <module Ada>
moduleC <module C>
moduleCOBOL <module COBOL>
moduleFortran <module Fortran>
moduleMUMPS <module MUMPS>
modulePascal <module Pascal>
modulePLI <module PL/I>
Part-nNo <Part n no>
standard <arc2>

Top


Please send feedback to Jonathan Leffler: jonathan.leffler@gmail.com .