



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




BNF Grammar for SQL /* The grammar rules that follow have been taken from / / "System R", Appendix II, M.M. Astrahan, et al., ACM Trans. / / on Database Systems, Vol. 1, No. 2, June 1976. / / The rules given below in BNF have the following assumptions: / / (1) all non-terminals are in lower-case, / / (2) all terminals (recognized by LEX/lex.yy.c) are in upper-case, */
<dml-statement> ::=
<select-clause> ::= SELECT <select-list>
<select-list> ::= <sel-expr-list> | MULT-OP
<sel-expr-list> ::= <sel-expr> | <sel-expr-list> COMMA <sel-expr>
<sel-expr> ::=
<from-list> ::= <table-name> | <from-list> COMMA <table-name>
<where-clause> ::=
<nested-select> ::=
<grp-ord-clause> ::=
<insert-spec-target> ::=
<field-name-list> ::= <field-name > | <field-name-list> COMMA <field-name>
<field-name-list> ::= <field-name > | <field-name-list> COMMA <field-name>
<insert-spec-source> ::=
<all-any> ::= ALL |ANY
<in-notin> ::= IN |NOT IN
<relat-op> ::= NE |RWEDGE |GE |LWEDGE |LE
<table-spec> ::=
<lit-tuple> ::=
<entry-list> ::=
<arith-term> ::= <arith-factor> | <arith-term> MULT-OP <arith-factor>
<arith-factor> ::= <opt-add-op>
<field-spec-list> ::= <field-spec>
<field-spec> ::= <field-name> | <table-name> DOT <field-name>
<set-fn> ::= AVG |MAX |MIN |SUM |COUNT
<constant-value> ::= IDENTIFIER |VALUE
<field-name> ::= IDENTIFIER
<table-name> ::= IDENTIFIER
Docsity.com