This file goes through the grammar for SQL 2011 queries (using the draft standard). There are other files which cover some of the other sections from SQL 2011 (ddl, non-query dml, etc). Possible sections not in the todo which could be covered: 13 modules 16 control statements 18 connection management 20 dynamic 22 direct 23 diagnostics procedural sql some of the main areas being left for now: temporal and versioning stuff modules ref stuff todo: finish this list The goal is to create some example tests for each bit of grammar, with some areas getting more comprehensive coverage tests, and also to note which parts aren't currently supported. > module Language.SQL.SimpleSQL.SQL2011Queries (sql2011QueryTests) where > import Language.SQL.SimpleSQL.TestTypes > import Language.SQL.SimpleSQL.Syntax > sql2011QueryTests :: TestItem > sql2011QueryTests = Group "sql 2011 query tests" > [literals > ,identifiers > ,typeNameTests > ,fieldDefinition > ,valueExpressions > ,queryExpressions > ,scalarSubquery > ,predicates > ,intervalQualifier > ,collateClause > ,aggregateFunction > ,sortSpecificationList > ] = 5 Lexical elements The tests don't make direct use of these definitions. == 5.1 Function Define the terminal symbols of the SQL language and the elements of strings. ::= ::= | | ::= | ::= A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ::= a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ::= | | | | | | | | | | | | | | | | | | | | | | | | | ::= !! See the Syntax Rules. ::= " ::= % ::= & ::= ' ::= ( ::= ) ::= * ::= + ::= , ::= - ::= . ::= / ::= \ ::= : ::= ; ::= < ::= = ::= > ::= ? ::= | ::= | ::= [ ::= ??( ::= ] ::= ??) ::= ^ ::= _ ::= | ::= { ::= } == 5.2 and Function Specify lexical units (tokens and separators) that participate in SQL language. ::= | ::= | | | | | | | | ::= ::= [ ... ] ::= | ::= !! See the Syntax Rules. ::= !! See the Syntax Rules. ::= ... ::= K | M | G | T | P ::= ::= ... ::= | ::= U ::= [ UESCAPE ] ::= ... ::= | ::= | | ::= ::= ::= ::= !! See the Syntax Rules. ::= !! See the Syntax Rules. ::= ""!! two consecutive double quote characters ::= | |