-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProduction_Rules
24 lines (18 loc) · 918 Bytes
/
Production_Rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Production Rules
<query> ::= <select-query> | <insert-query> | <update-query> | <delete-query>
<select-query> ::= "SELECT" <columns> "FROM" <table> [ "WHERE" <condition> ]
<columns> ::= "*" | <column> | <column> "," <columns>
<column> ::= <identifier>
<table> ::= <identifier>
<condition> ::= <expression> <operator> <value>
<expression> ::= <identifier>
<operator> ::= "=" | "!=" | ">" | "<" | ">=" | "<="
<value> ::= <number> | <string>
<insert-query> ::= "INSERT INTO" <table> "(" <columns> ")" "VALUES" "(" <values> ")"
<values> ::= <value> | <value> "," <values>
<update-query> ::= "UPDATE" <table> "SET" <assignments> [ "WHERE" <condition> ]
<assignments> ::= <column> "=" <value> | <column> "=" <value> "," <assignments>
<delete-query> ::= "DELETE FROM" <table> [ "WHERE" <condition> ]
<identifier> ::= any sequence of alphanumeric characters
<number> ::= any numeric value
<string> ::= any quoted string