Skip to content

Instantly share code, notes, and snippets.

@kelvingakuo
Last active November 18, 2021 18:56
Show Gist options
  • Save kelvingakuo/498f84518050bc93169a560d12c3185e to your computer and use it in GitHub Desktop.
Save kelvingakuo/498f84518050bc93169a560d12c3185e to your computer and use it in GitHub Desktop.
<query> ::= "SELECT " <columns> " FROM " <name> <terminal> | "SELECT " <columns> " FROM " <name> " WHERE " <conditionList> <terminal>
<columns> ::= (<name> ", ")+ | "*"
<name> ::= <letter>+ | <letter>+ "_" | <letter>+ "_" <digit>+
<conditionList> ::= <condition> <comparator> <condition>
<comparator> ::= " AND " | " OR "
<condition> ::= <name> <operator> <term>
<operator> ::= " = " | " > " | " >= " | " < " | " <= "
<term> ::= <digit> | <digit> "." <digit> | <name>
<letter> ::= [a-z]+ | [A-Z]+
<digit> ::= [1-9]+
<terminal> ::= ";"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment