Advertisement
filmee24

sql grammar

Jan 10th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1.  
  2. command ::= define_data
  3. | modify_data
  4. | system_command
  5.  
  6. define_data ::= create_command
  7.  
  8. modify_data ::= select_command
  9. | insert_command
  10. | update_command
  11. | delete_command
  12.  
  13. system_command ::=
  14. | describe_command
  15. | open_command
  16. | close_command
  17. | save_command
  18. | list_command
  19. | clear_command
  20. | dump_command
  21. | help_command
  22.  
  23. create_command ::=
  24. ( "CREATE" | "create" ) (character_set)+
  25. "("((character_set)+,)+")"
  26. ("WITH"|"with") ("VALUES"|"values")
  27. "("((character_set)+,)+")"
  28.  
  29. select_command ::=
  30. ("SELECT"|"select")
  31. ("*"|(character_set)+)
  32. ("FROM"|"from")
  33. (character_set)+
  34. [("WHERE"|"where") condition]
  35. [("LIMIT"|"limit") (numeric)+]
  36.  
  37. insert_command ::=
  38. ( "INSERT" | "insert" )
  39. ("INTO"|"into")
  40. (character_set)+
  41. "("((character_set)+,)+")"
  42. ("VALUES"|"values")
  43. "("((character_set)+,)+")"
  44.  
  45. update_command ::=
  46. ("UPDATE"|update")
  47. (character_set)+
  48. ("SET"|"set")
  49. (character_set)+
  50. "="
  51. (character_set)+
  52. [("WHERE"|"where") condition]
  53.  
  54. delete_command ::=
  55. ("DELETE"|"delete")
  56. ("FROM"|"from")
  57. (character_set)+
  58. [("WHERE"|"where") condition]
  59.  
  60. open_command ::=
  61. ("OPEN"|"open")
  62. (character_set)+
  63.  
  64. close_command ::=
  65. ("CLOSE"|"close")
  66. (character_set)+
  67.  
  68. save_command ::=
  69. ("SAVE"|"save")
  70. | ("SAVE"|"save")
  71. ("AS"|"as")
  72. (character_set)+
  73.  
  74. list ::=
  75. ("LS"|"ls"|"DIR"|"dir")
  76. | ("LS"|"ls"|"DIR"|"dir")
  77. (character_set)+
  78.  
  79. clear ::=
  80. ("CLEAR"|"clear"|"CLS"|"cls")
  81.  
  82. dump ::=
  83. ("DUMP"|"dump")
  84.  
  85. help ::=
  86. ("help"|"HELP"|"/HELP"|"/help"|"/?")
  87.  
  88. condition ::=
  89. (character_set)+
  90. (["<"|">"|"!"]=|["<"|">"|"="])
  91. (character_set)+
  92. [(("AND"|"and")|("OR"|"or"))
  93. (character_set)+
  94. (["<"|">"|"!"]=|["<"|">"|"="])
  95. (character_set)+]
  96.  
  97. character_set ::=
  98. "a"|"b"|"c"|"d"|"e"|"f"|"g"|"h"|"i"|"j"|"k"|"l"|"m"
  99. "n"|"o"|"p"|"q"|"r"|"s"|"t"|"u"|"v"|"w"|"x"|"y"|"z"
  100. |"A"|"B"|"C"|"D"|"E"|"F"|"G"|"H"|"I"|"J"|"K"|"L"|"M"
  101. |"N"|"O"|"P"|"Q"|"R"|"S"|"T"|"U"|"V"|"W"|"X"|"Y"|"Z"
  102. |"0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
  103. |"-"|"_"|"("|")"|"."|","|"""|"/"|"\"|"@"|"#"|"~"|"|"
  104. |"*"|"&"|"%"|"$"|"£"|"!"|"+"|"?"|">"|"<"|"="
  105.  
  106. numeric ::=
  107. "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement