-
Notifications
You must be signed in to change notification settings - Fork 0
/
sql.mi
34 lines (24 loc) · 898 Bytes
/
sql.mi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
INHERITANCE.
SQL-PROGRAM:
<
SELECT
>.
ATTR-EXPRESSION:
<
EQ-EXPRESSION;
IN-EXPRESSION;
LIKE-EXPRESSION;
NEQ-EXPRESSION
>.
SYNTAX.
Start = SQL-PROGRAM.
SELECT ::= "select" [ column => COLUMN ] + ","
"from" [ tables => identifier ]+ ","
"where" condition => CONDITION ;
COLUMN ::= [ table-name => identifier "." ] ! column-name => identifier;
IN-EXPRESSION ::= column => identifier "in" "(" select => SELECT ")";
EQ-EXPRESSION ::= column => identifier "=" value => string;
LIKE-EXPRESSION ::= column => identifier "like" value => string;
NEQ-EXPRESSION ::= column => identifier "<>" value => string;
AND-EXPRESSION ::= bool-expression => ATTR-EXPRESSION "and" bool-expression => ATTR-EXPRESSION;
CONDITION ::= and => AND-EXPRESSION | attr => ATTR-EXPRESSION;