Start:

Start    ::= Statement ( ';' Statement )*

no references


AlterTableStmt:

AlterTableStmt
         ::= 'ALTER' IgnoreOptional 'TABLE' TableName AlterTableSpec ( ',' AlterTableSpec )*

referenced by:


AlterTableSpec:

AlterTableSpec
         ::= TableOptionListOpt
           | 'ADD' ( ColumnKeywordOpt ColumnDef ColumnPosition | Constraint )
           | 'DROP' ( ColumnKeywordOpt ColumnName | 'PRIMARY' 'KEY' | KeyOrIndex IndexName | 'FOREIGN' 'KEY' Symbol )
           | ( 'DISABLE' | 'ENABLE' ) 'KEYS'

referenced by:


KeyOrIndex:

KeyOrIndex
         ::= 'KEY'
           | 'INDEX'

referenced by:


ColumnKeywordOpt:

ColumnKeywordOpt
         ::= ''
           | 'COLUMN'

referenced by:


ColumnPosition:

ColumnPosition
         ::= ''
           | 'FIRST'
           | 'AFTER' ColumnName

referenced by:


ConstraintKeywordOpt:

ConstraintKeywordOpt
         ::= ''
           | 'CONSTRAINT' Symbol?

referenced by:


Symbol:

Symbol   ::= Identifier

referenced by:


AnalyzeTableStmt:

AnalyzeTableStmt
         ::= 'ANALYZE' 'TABLE' TableNameList

referenced by:


Assignment:

Assignment
         ::= ColumnName '=' Expression

referenced by:


AssignmentList:

AssignmentList
         ::= Assignment ( ',' Assignment )*

referenced by:


BeginTransactionStmt:

BeginTransactionStmt
         ::= 'BEGIN'
           | 'START' 'TRANSACTION' ( 'WITH' 'CONSISTENT' 'SNAPSHOT' )?

referenced by:


BinlogStmt:

BinlogStmt
         ::= 'BINLOG' 'string literal'

referenced by:


ColumnDef:

ColumnDef
         ::= ColumnName Type ColumnOptionListOpt

referenced by:


ColumnName:

ColumnName
         ::= Identifier ( '.' Identifier ( '.' Identifier )? )?

referenced by:


ColumnNameList:

ColumnNameList
         ::= ColumnName ( ',' ColumnName )*

referenced by:


ColumnNameListOpt:

ColumnNameListOpt
         ::= ''
           | ColumnNameList

referenced by:


PrimaryOpt:

PrimaryOpt
         ::= ''
           | 'PRIMARY'

referenced by:


ColumnOption:

ColumnOption
         ::= 'NOT'? 'NULL'
           | 'AUTO_INCREMENT'
           | PrimaryOpt 'KEY'
           | 'UNIQUE' 'KEY'?
           | 'DEFAULT' DefaultValueExpr
           | 'ON' 'UPDATE' NowSym
           | 'COMMENT' 'string literal'
           | 'CHECK' '(' Expression ')'

referenced by:


ColumnOptionListOpt:

ColumnOptionListOpt
         ::= ''
           | ColumnOption+

referenced by:


ConstraintElem:

ConstraintElem
         ::= ( ( 'PRIMARY' 'KEY' | ( 'INDEX' | 'KEY' | 'UNIQUE' ( 'INDEX' | 'KEY' )? ) IndexName ) IndexTypeOpt | 'FULLTEXT' 'KEY' IndexName ) '(' IndexColNameList ')' IndexOption
           | 'FOREIGN' 'KEY' IndexName '(' IndexColNameList ')' ReferDef

referenced by:


ReferDef:

ReferDef ::= 'REFERENCES' TableName '(' IndexColNameList ')' OnDeleteOpt OnUpdateOpt

referenced by:


OnDeleteOpt:

OnDeleteOpt
         ::= ''
           | 'ON' 'DELETE' ReferOpt

referenced by:


OnUpdateOpt:

OnUpdateOpt
         ::= ''
           | 'ON' 'UPDATE' ReferOpt

referenced by:


ReferOpt:

ReferOpt ::= 'RESTRICT'
           | 'CASCADE'
           | 'SET' 'NULL'
           | 'NO' 'ACTION'

referenced by:


DefaultValueExpr:

DefaultValueExpr
         ::= NowSym ( '(' ')' )?
           | SignedLiteral

referenced by:


NowSym:

NowSym   ::= 'CURRENT_TIMESTAMP'
           | 'LOCALTIME'
           | 'LOCALTIMESTAMP'
           | 'NOW'

referenced by:


SignedLiteral:

SignedLiteral
         ::= Literal
           | ( '+' | '-' ) NumLiteral

referenced by:


NumLiteral:

NumLiteral
         ::= 'integer literal'
           | 'floating-point literal'

referenced by:


CreateIndexStmt:

CreateIndexStmt
         ::= 'CREATE' CreateIndexStmtUnique 'INDEX' Identifier 'ON' TableName '(' IndexColNameList ')'

referenced by:


CreateIndexStmtUnique:

CreateIndexStmtUnique
         ::= ''
           | 'UNIQUE'

referenced by:


IndexColName:

IndexColName
         ::= ColumnName OptFieldLen Order

referenced by:


IndexColNameList:

IndexColNameList
         ::= ( '' | IndexColName ) ( ',' IndexColName )*

referenced by:


CreateDatabaseStmt:

CreateDatabaseStmt
         ::= 'CREATE' DatabaseSym IfNotExists DBName DatabaseOptionListOpt

referenced by:


DBName:

DBName   ::= Identifier

referenced by:


DatabaseOption:

DatabaseOption
         ::= DefaultKwdOpt ( CharsetKw EqOpt CharsetName | 'COLLATE' EqOpt StringName )

referenced by:


DatabaseOptionListOpt:

DatabaseOptionListOpt
         ::= ''
           | DatabaseOption+

referenced by:


CreateTableStmt:

CreateTableStmt
         ::= 'CREATE' 'TABLE' IfNotExists TableName '(' TableElement ( ',' TableElement )* ')' TableOptionListOpt

referenced by:


DefaultKwdOpt:

DefaultKwdOpt
         ::= ''
           | 'DEFAULT'

referenced by:


DoStmt:

DoStmt   ::= 'DO' ExpressionList

referenced by:


DeleteFromStmt:

DeleteFromStmt
         ::= 'DELETE' LowPriorityOptional QuickOptional IgnoreOptional ( 'FROM' ( TableName WhereClauseOptional OrderByOptional LimitClause | TableNameList 'USING' TableRefs WhereClauseOptional ) | TableNameList 'FROM' TableRefs WhereClauseOptional )

referenced by:


DatabaseSym:

DatabaseSym
         ::= 'DATABASE'
           | 'SCHEMA'

referenced by:


DropDatabaseStmt:

DropDatabaseStmt
         ::= 'DROP' DatabaseSym IfExists DBName

referenced by:


DropIndexStmt:

DropIndexStmt
         ::= 'DROP' 'INDEX' IfExists Identifier 'ON' TableName

referenced by:


DropTableStmt:

DropTableStmt
         ::= 'DROP' TableOrTables ( 'IF' 'EXISTS' )? TableNameList

referenced by:


TableOrTables:

TableOrTables
         ::= 'TABLE'
           | 'TABLES'

referenced by:


EqOpt:

EqOpt    ::= ''
           | '='

referenced by:


ExplainSym:

ExplainSym
         ::= 'EXPLAIN'
           | 'DESCRIBE'
           | 'DESC'

referenced by:


ExplainStmt:

ExplainStmt
         ::= ExplainSym ( TableName ColumnName? | ExplainableStmt )

referenced by:


Expression:

Expression
         ::= ( 'USER_VAR' ' ::==' | 'NOT' | Expression ( logOr | 'XOR' | logAnd ) ) Expression
           | PredicateExpr ( 'IS' NotOpt 'NULL' | CompareOp ( ( 'USER_VAR' ' ::==' )? PredicateExpr | AnyOrAll SubSelect ) )* ( 'IS' NotOpt ( 'true' | 'false' | 'UNKNOWN' ) )?

referenced by:


logOr:

logOr    ::= '||'
           | 'OR'

referenced by:


logAnd:

logAnd   ::= '&&'
           | 'AND'

referenced by:


ExpressionList:

ExpressionList
         ::= Expression ( ',' Expression )*

referenced by:


ExpressionListOpt:

ExpressionListOpt
         ::= ''
           | ExpressionList

referenced by:


CompareOp:

CompareOp
         ::= '>='
           | '>'
           | '<='
           | '<'
           | '!='
           | '<>'
           | '='
           | '<=>'

referenced by:


AnyOrAll:

AnyOrAll ::= 'ANY'
           | 'SOME'
           | 'ALL'

referenced by:


PredicateExpr:

PredicateExpr
         ::= PrimaryFactor ( NotOpt 'BETWEEN' PrimaryFactor 'AND' PrimaryFactor )* ( NotOpt ( 'IN' ( '(' ExpressionList ')' | SubSelect ) | 'LIKE' PrimaryExpression LikeEscapeOpt | RegexpSym PrimaryExpression ) )?

referenced by:


RegexpSym:

RegexpSym
         ::= 'REGEXP'
           | 'RLIKE'

referenced by:


LikeEscapeOpt:

LikeEscapeOpt
         ::= ''
           | 'ESCAPE' 'string literal'

referenced by:


NotOpt:

NotOpt   ::= ''
           | 'NOT'

referenced by:


Field:

Field    ::= ( Identifier '.' ( Identifier '.' )? )? '*'
           | Expression FieldAsNameOpt

referenced by:


FieldAsNameOpt:

FieldAsNameOpt
         ::= ''
           | FieldAsName

referenced by:


FieldAsName:

FieldAsName
         ::= 'AS'? ( Identifier | 'string literal' )

referenced by:


GroupByClause:

GroupByClause
         ::= 'GROUP' 'BY' ByList

referenced by:


HavingClause:

HavingClause
         ::= ''
           | 'HAVING' Expression

referenced by:


IfExists:

IfExists ::= ''
           | 'IF' 'EXISTS'

referenced by:


IfNotExists:

IfNotExists
         ::= ''
           | 'IF' 'NOT' 'EXISTS'

referenced by:


IgnoreOptional:

IgnoreOptional
         ::= ''
           | 'IGNORE'

referenced by:


IndexName:

IndexName
         ::= ''
           | Identifier

referenced by:


IndexOption:

IndexOption
         ::= ''
           | 'KEY_BLOCK_SIZE' EqOpt 'integer literal'
           | IndexType
           | 'COMMENT' 'string literal'

referenced by:


IndexType:

IndexType
         ::= 'USING' ( 'BTREE' | 'HASH' )

referenced by:


IndexTypeOpt:

IndexTypeOpt
         ::= ''
           | IndexType

referenced by:


Identifier:

Identifier
         ::= 'identifier'
           | UnReservedKeyword
           | NotKeywordToken

referenced by:


UnReservedKeyword:

UnReservedKeyword
         ::= 'ACTION'
           | 'ASCII'
           | 'AUTO_INCREMENT'
           | 'AFTER'
           | 'AVG'
           | 'BEGIN'
           | 'BIT'
           | 'BOOL'
           | 'BOOLEAN'
           | 'BTREE'
           | 'CHARSET'
           | 'COLUMNS'
           | 'COMMIT'
           | 'COMPACT'
           | 'COMPRESSED'
           | 'CONSISTENT'
           | 'DATA'
           | 'DATE'
           | 'DATETIME'
           | 'DEALLOCATE'
           | 'DO'
           | 'DYNAMIC'
           | 'END'
           | 'ENGINE'
           | 'ENGINES'
           | 'ESCAPE'
           | 'EXECUTE'
           | 'FIELDS'
           | 'FIRST'
           | 'FIXED'
           | 'FULL'
           | 'GLOBAL'
           | 'HASH'
           | 'LOCAL'
           | 'NAMES'
           | 'OFFSET'
           | 'PASSWORD'
           | 'PREPARE'
           | 'QUICK'
           | 'REDUNDANT'
           | 'ROLLBACK'
           | 'SESSION'
           | 'SIGNED'
           | 'SNAPSHOT'
           | 'START'
           | 'STATUS'
           | 'TABLES'
           | 'TEXT'
           | 'TIME'
           | 'TIMESTAMP'
           | 'TRANSACTION'
           | 'TRUNCATE'
           | 'UNKNOWN'
           | 'VALUE'
           | 'WARNINGS'
           | 'YEAR'
           | 'MODE'
           | 'WEEK'
           | 'ANY'
           | 'SOME'
           | 'USER'
           | 'IDENTIFIED'
           | 'COLLATION'
           | 'COMMENT'
           | 'AVG_ROW_LENGTH'
           | 'CONNECTION'
           | 'CHECKSUM'
           | 'COMPRESSION'
           | 'KEY_BLOCK_SIZE'
           | 'MAX_ROWS'
           | 'MIN_ROWS'
           | 'NATIONAL'
           | 'ROW'
           | 'ROW_FORMAT'
           | 'QUARTER'
           | 'GRANTS'
           | 'TRIGGERS'
           | 'DELAY_KEY_WRITE'
           | 'ISOLATION'
           | 'REPEATABLE'
           | 'COMMITTED'
           | 'UNCOMMITTED'
           | 'ONLY'
           | 'SERIALIZABLE'
           | 'LEVEL'
           | 'VARIABLES'
           | 'SQL_CACHE'
           | 'SQL_NO_CACHE'
           | 'DISABLE'
           | 'ENABLE'
           | 'REVERSE'
           | 'SPACE'
           | 'PRIVILEGES'
           | 'NO'
           | 'BINLOG'
           | 'FUNCTION'

referenced by:


NotKeywordToken:

NotKeywordToken
         ::= 'ABS'
           | 'ADDDATE'
           | 'ADMIN'
           | 'COALESCE'
           | 'CONCAT'
           | 'CONCAT_WS'
           | 'CONNECTION_ID'
           | 'CUR_TIME'
           | 'COUNT'
           | 'DAY'
           | 'DATE_ADD'
           | 'DATE_FORMAT'
           | 'DATE_SUB'
           | 'DAYNAME'
           | 'DAYOFMONTH'
           | 'DAYOFWEEK'
           | 'DAYOFYEAR'
           | 'FOUND_ROWS'
           | 'GROUP_CONCAT'
           | 'GREATEST'
           | 'HOUR'
           | 'HEX'
           | 'UNHEX'
           | 'IFNULL'
           | 'ISNULL'
           | 'LAST_INSERT_ID'
           | 'LCASE'
           | 'LENGTH'
           | 'LOCATE'
           | 'LOWER'
           | 'LTRIM'
           | 'MAX'
           | 'MICROSECOND'
           | 'MIN'
           | 'MINUTE'
           | 'NULLIF'
           | 'MONTH'
           | 'MONTHNAME'
           | 'NOW'
           | 'POW'
           | 'POWER'
           | 'RAND'
           | 'SECOND'
           | 'SLEEP'
           | 'SQL_CALC_FOUND_ROWS'
           | 'SUBDATE'
           | 'SUBSTRING'
           | 'SUBSTRING_INDEX'
           | 'SUM'
           | 'TRIM'
           | 'RTRIM'
           | 'UCASE'
           | 'UPPER'
           | 'VERSION'
           | 'WEEKDAY'
           | 'WEEKOFYEAR'
           | 'YEARWEEK'
           | 'ROUND'
           | 'STATS_PERSISTENT'
           | 'GET_LOCK'
           | 'RELEASE_LOCK'
           | 'CEIL'
           | 'CEILING'

referenced by:


InsertIntoStmt:

InsertIntoStmt
         ::= 'INSERT' Priority IgnoreOptional IntoOpt TableName InsertValues OnDuplicateKeyUpdate

referenced by:


IntoOpt:

IntoOpt  ::= ''
           | 'INTO'

referenced by:


InsertValues:

InsertValues
         ::= ( '(' ColumnNameListOpt ')' )? ( ValueSym ExpressionListListItem ( ',' ExpressionListListItem )* | SelectStmt | UnionStmt )
           | 'SET' ( '' | ColumnSetValue ) ( ',' ColumnSetValue )*

referenced by:


ValueSym:

ValueSym ::= 'VALUE'
           | 'VALUES'

referenced by:


ExpressionListListItem:

ExpressionListListItem
         ::= '(' ExpressionListOpt ')'

referenced by:


ColumnSetValue:

ColumnSetValue
         ::= ColumnName '=' Expression

referenced by:


OnDuplicateKeyUpdate:

OnDuplicateKeyUpdate
         ::= ''
           | 'ON' 'DUPLICATE' 'KEY' 'UPDATE' AssignmentList

referenced by:


ReplaceIntoStmt:

ReplaceIntoStmt
         ::= 'REPLACE' ReplacePriority IntoOpt TableName InsertValues

referenced by:


ReplacePriority:

ReplacePriority
         ::= ''
           | 'LOW_PRIORITY'
           | 'DELAYED'

referenced by:


Literal:

Literal  ::= 'false'
           | 'NULL'
           | 'true'
           | 'floating-point literal'
           | 'integer literal'
           | 'UNDERSCORE_CHARSET'? 'string literal'
           | 'hexadecimal literal'
           | 'bit literal'

referenced by:


Operand:

Operand  ::= Literal
           | ColumnName
           | ( '(' ( ExpressionList ',' )? | 'ROW' '(' ExpressionList ',' ) Expression ')'
           | 'DEFAULT' ( '(' ColumnName ')' )?
           | Variable
           | 'PLACEHOLDER'
           | 'EXISTS' SubSelect

referenced by:


OrderBy:

OrderBy  ::= 'ORDER' 'BY' ByList

referenced by:


ByList:

ByList   ::= ByItem ( ',' ByItem )*

referenced by:


ByItem:

ByItem   ::= Expression Order

referenced by:


Order:

Order    ::= ''
           | 'ASC'
           | 'DESC'

referenced by:


OrderByOptional:

OrderByOptional
         ::= ''
           | OrderBy

referenced by:


PrimaryExpression:

PrimaryExpression
         ::= Operand
           | Function
           | SubSelect
           | ( '!' | '~' | '-' | '+' | 'BINARY' ) PrimaryExpression
           | PrimaryExpression 'COLLATE' StringName

referenced by:


Function:

Function ::= FunctionCallKeyword
           | FunctionCallNonKeyword
           | FunctionCallConflict
           | FunctionCallAgg

referenced by:


FunctionNameConflict:

FunctionNameConflict
         ::= 'DATABASE'
           | 'SCHEMA'
           | 'IF'
           | 'LEFT'
           | 'REPEAT'
           | 'CURRENT_USER'
           | 'CURRENT_DATE'
           | 'UTC_DATE'
           | 'VERSION'

referenced by:


FunctionCallConflict:

FunctionCallConflict
         ::= ( FunctionNameConflict '(' ExpressionListOpt | 'MOD' '(' PrimaryFactor ',' PrimaryFactor ) ')'
           | 'CURRENT_USER'
           | 'CURRENT_DATE'
           | 'UTC_DATE'

referenced by:


DistinctOpt:

DistinctOpt
         ::= ''
           | 'ALL'
           | 'DISTINCT' 'ALL'?

referenced by:


FunctionCallKeyword:

FunctionCallKeyword
         ::= ( 'CAST' '(' Expression 'AS' CastType | ( 'ASCII' | 'DATE' | 'YEAR' ) '(' Expression | 'USER' '(' | 'VALUES' '(' ColumnName | 'WEEK' '(' ExpressionList | 'CONVERT' '(' Expression ( 'USING' StringName | ',' CastType ) ) ')'
           | 'CASE' ExpressionOpt WhenClause+ ElseOpt 'END'

referenced by:


FunctionCallNonKeyword:

FunctionCallNonKeyword
         ::= 'COALESCE' '(' ExpressionList ')'
           | 'CURDATE' '(' ')'
           | 'CUR_TIME' '(' ExpressionOpt ')'
           | 'CURRENT_TIME' FuncDatetimePrec
           | 'CURRENT_TIMESTAMP' FuncDatetimePrec
           | 'ABS' '(' Expression ')'
           | 'CONCAT' '(' ExpressionList ')'
           | 'CONCAT_WS' '(' ExpressionList ')'
           | 'CEIL' '(' Expression ')'
           | 'CEILING' '(' Expression ')'
           | 'DAY' '(' Expression ')'
           | 'DAYNAME' '(' Expression ')'
           | 'DAYOFWEEK' '(' Expression ')'
           | 'DAYOFMONTH' '(' Expression ')'
           | 'DAYOFYEAR' '(' Expression ')'
           | DateArithOpt '(' Expression ',' 'INTERVAL' Expression TimeUnit ')'
           | DateArithMultiFormsOpt '(' Expression ',' DateArithInterval ')'
           | 'DATE_FORMAT' '(' Expression ',' Expression ')'
           | 'EXTRACT' '(' TimeUnit 'FROM' Expression ')'
           | 'FOUND_ROWS' '(' ')'
           | 'GREATEST' '(' ExpressionList ')'
           | 'HOUR' '(' Expression ')'
           | 'HEX' '(' Expression ')'
           | 'UNHEX' '(' Expression ')'
           | 'IFNULL' '(' ExpressionList ')'
           | 'ISNULL' '(' Expression ')'
           | 'LAST_INSERT_ID' '(' ExpressionOpt ')'
           | 'LENGTH' '(' Expression ')'
           | 'LOCATE' '(' Expression ',' Expression ')'
           | 'LOCATE' '(' Expression ',' Expression ',' Expression ')'
           | 'LOWER' '(' Expression ')'
           | 'LCASE' '(' Expression ')'
           | 'LTRIM' '(' Expression ')'
           | 'MICROSECOND' '(' Expression ')'
           | 'MINUTE' '(' Expression ')'
           | 'MONTH' '(' Expression ')'
           | 'MONTHNAME' '(' Expression ')'
           | 'NOW' '(' ExpressionOpt ')'
           | 'NULLIF' '(' ExpressionList ')'
           | 'POW' '(' Expression ',' Expression ')'
           | 'POWER' '(' Expression ',' Expression ')'
           | 'RAND' '(' ExpressionOpt ')'
           | 'REPLACE' '(' Expression ',' Expression ',' Expression ')'
           | 'REVERSE' '(' Expression ')'
           | 'RTRIM' '(' Expression ')'
           | 'SECOND' '(' Expression ')'
           | 'SLEEP' '(' Expression ')'
           | 'SPACE' '(' Expression ')'
           | 'STRCMP' '(' Expression ',' Expression ')'
           | 'SUBSTRING' '(' Expression ',' Expression ')'
           | 'SUBSTRING' '(' Expression 'FROM' Expression ')'
           | 'SUBSTRING' '(' Expression ',' Expression ',' Expression ')'
           | 'SUBSTRING' '(' Expression 'FROM' Expression 'FOR' Expression ')'
           | 'SUBSTRING_INDEX' '(' Expression ',' Expression ',' Expression ')'
           | 'SYSDATE' '(' ExpressionOpt ')'
           | 'TIME' '(' Expression ')'
           | 'TRIM' '(' Expression ')'
           | 'TRIM' '(' Expression 'FROM' Expression ')'
           | 'TRIM' '(' TrimDirection 'FROM' Expression ')'
           | 'TRIM' '(' TrimDirection Expression 'FROM' Expression ')'
           | 'UPPER' '(' Expression ')'
           | 'UCASE' '(' Expression ')'
           | 'WEEKDAY' '(' Expression ')'
           | 'WEEKOFYEAR' '(' Expression ')'
           | 'YEARWEEK' '(' ExpressionList ')'
           | 'CONNECTION_ID' '(' ')'
           | 'ROUND' '(' ExpressionList ')'
           | 'GET_LOCK' '(' Expression ',' Expression ')'
           | 'RELEASE_LOCK' '(' Expression ')'

referenced by:


DateArithOpt:

DateArithOpt
         ::= 'DATE_ADD'
           | 'DATE_SUB'

referenced by:


DateArithMultiFormsOpt:

DateArithMultiFormsOpt
         ::= 'ADDDATE'
           | 'SUBDATE'

referenced by:


DateArithInterval:

DateArithInterval
         ::= Expression
           | 'INTERVAL' Expression TimeUnit

referenced by:


TrimDirection:

TrimDirection
         ::= 'BOTH'
           | 'LEADING'
           | 'TRAILING'

referenced by:


FunctionCallAgg:

FunctionCallAgg
         ::= ( ( 'AVG' | 'GROUP_CONCAT' ) '(' DistinctOpt ExpressionList | ( 'MAX' | 'MIN' | 'SUM' ) '(' DistinctOpt Expression | 'COUNT' '(' DistinctOpt ( ExpressionList | '*' ) ) ')'

referenced by:


FuncDatetimePrec:

FuncDatetimePrec
         ::= ''
           | '(' Expression? ')'

referenced by:


TimeUnit:

TimeUnit ::= 'MICROSECOND'
           | 'SECOND'
           | 'MINUTE'
           | 'HOUR'
           | 'DAY'
           | 'WEEK'
           | 'MONTH'
           | 'QUARTER'
           | 'YEAR'
           | 'SECOND_MICROSECOND'
           | 'MINUTE_MICROSECOND'
           | 'MINUTE_SECOND'
           | 'HOUR_MICROSECOND'
           | 'HOUR_SECOND'
           | 'HOUR_MINUTE'
           | 'DAY_MICROSECOND'
           | 'DAY_SECOND'
           | 'DAY_MINUTE'
           | 'DAY_HOUR'
           | 'YEAR_MONTH'

referenced by:


ExpressionOpt:

ExpressionOpt
         ::= ''
           | Expression

referenced by:


WhenClause:

WhenClause
         ::= 'WHEN' Expression 'THEN' Expression

referenced by:


ElseOpt:

ElseOpt  ::= ''
           | 'ELSE' Expression

referenced by:


CastType:

CastType ::= ( 'BINARY' | 'DATETIME' | 'TIME' ) OptFieldLen
           | 'CHAR' OptFieldLen OptBinary OptCharset
           | 'DATE'
           | 'DECIMAL' FloatOpt
           | ( 'SIGNED' | 'UNSIGNED' ) OptInteger

referenced by:


PrimaryFactor:

PrimaryFactor
         ::= PrimaryFactor ( '|' | '&' | '<<' | '>>' | '+' | '-' | '*' | '/' | '%' | 'DIV' | 'MOD' | '^' ) PrimaryFactor
           | PrimaryExpression

referenced by:


Priority:

Priority ::= ''
           | 'LOW_PRIORITY'
           | 'HIGH_PRIORITY'
           | 'DELAYED'

referenced by:


LowPriorityOptional:

LowPriorityOptional
         ::= ''
           | 'LOW_PRIORITY'

referenced by:


TableName:

TableName
         ::= Identifier ( '.' Identifier )?

referenced by:


TableNameList:

TableNameList
         ::= TableName ( ',' TableName )*

referenced by:


QuickOptional:

QuickOptional
         ::= ''
           | 'QUICK'

referenced by:


PreparedStmt:

PreparedStmt
         ::= 'PREPARE' Identifier 'FROM' PrepareSQL

referenced by:


PrepareSQL:

PrepareSQL
         ::= 'string literal'
           | 'USER_VAR'

referenced by:


ExecuteStmt:

ExecuteStmt
         ::= 'EXECUTE' Identifier ( 'USING' 'USER_VAR' ( ',' 'USER_VAR' )* )?

referenced by:


DeallocateStmt:

DeallocateStmt
         ::= DeallocateSym 'PREPARE' Identifier

referenced by:


DeallocateSym:

DeallocateSym
         ::= 'DEALLOCATE'
           | 'DROP'

referenced by:


SelectStmt:

SelectStmt
         ::= 'SELECT' SelectStmtOpts SelectStmtFieldList ( FromDual WhereClauseOptional | 'FROM' TableRefsClause WhereClauseOptional SelectStmtGroup HavingClause OrderByOptional )? SelectStmtLimit SelectLockOpt

referenced by:


FromDual:

FromDual ::= 'FROM' 'DUAL'

referenced by:


TableRefsClause:

TableRefsClause
         ::= TableRefs

referenced by:


TableRefs:

TableRefs
         ::= EscapedTableRef ( ',' EscapedTableRef )*

referenced by:


EscapedTableRef:

EscapedTableRef
         ::= TableRef
           | '{' Identifier TableRef '}'

referenced by:


TableRef:

TableRef ::= TableFactor
           | JoinTable

referenced by:


TableFactor:

TableFactor
         ::= TableName TableAsNameOpt IndexHintListOpt
           | '(' ( ( SelectStmt | UnionStmt ) ')' TableAsName | TableRefs ')' )

referenced by:


TableAsNameOpt:

TableAsNameOpt
         ::= ''
           | TableAsName

referenced by:


TableAsName:

TableAsName
         ::= 'AS'? Identifier

referenced by:


IndexHintType:

IndexHintType
         ::= ( 'USE' | 'IGNORE' | 'FORCE' ) KeyOrIndex

referenced by:


IndexHintScope:

IndexHintScope
         ::= ''
           | 'FOR' ( 'JOIN' | ( 'ORDER' | 'GROUP' ) 'BY' )

referenced by:


IndexHint:

IndexHint
         ::= IndexHintType IndexHintScope '(' ( '' | Identifier ) ( ',' Identifier )* ')'

referenced by:


IndexHintListOpt:

IndexHintListOpt
         ::= ''
           | IndexHint+

referenced by:


JoinTable:

JoinTable
         ::= TableRef ( CrossOpt TableRef ( 'ON' Expression )? | JoinType OuterOpt 'JOIN' TableRef 'ON' Expression )

referenced by:


JoinType:

JoinType ::= 'LEFT'
           | 'RIGHT'

referenced by:


OuterOpt:

OuterOpt ::= ''
           | 'OUTER'

referenced by:


CrossOpt:

CrossOpt ::= ( 'CROSS' | 'INNER' )? 'JOIN'

referenced by:


LimitClause:

LimitClause
         ::= ''
           | 'LIMIT' 'integer literal'

referenced by:


SelectStmtLimit:

SelectStmtLimit
         ::= ''
           | 'LIMIT' 'integer literal' ( ( ',' | 'OFFSET' ) 'integer literal' )?

referenced by:


SelectStmtDistinct:

SelectStmtDistinct
         ::= ''
           | 'ALL'
           | 'DISTINCT'

referenced by:


SelectStmtOpts:

SelectStmtOpts
         ::= SelectStmtDistinct SelectStmtSQLCache SelectStmtCalcFoundRows

referenced by:


SelectStmtCalcFoundRows:

SelectStmtCalcFoundRows
         ::= ''
           | 'SQL_CALC_FOUND_ROWS'

referenced by:


SelectStmtSQLCache:

SelectStmtSQLCache
         ::= ''
           | 'SQL_CACHE'
           | 'SQL_NO_CACHE'

referenced by:


SelectStmtFieldList:

SelectStmtFieldList
         ::= Field ( ',' Field )*

referenced by:


SelectStmtGroup:

SelectStmtGroup
         ::= ''
           | GroupByClause

referenced by:


SubSelect:

SubSelect
         ::= '(' ( SelectStmt | UnionStmt ) ')'

referenced by:


SelectLockOpt:

SelectLockOpt
         ::= ''
           | 'FOR' 'UPDATE'
           | 'LOCK' 'IN' 'SHARE' 'MODE'

referenced by:


UnionStmt:

UnionStmt
         ::= ( UnionSelect 'UNION' UnionOpt )+ ( SelectStmt | '(' SelectStmt ')' OrderByOptional SelectStmtLimit )

referenced by:


UnionSelect:

UnionSelect
         ::= SelectStmt
           | '(' SelectStmt ')'

referenced by:


UnionOpt:

UnionOpt ::= ''
           | 'ALL'
           | 'DISTINCT'

referenced by:


SetStmt:

SetStmt  ::= 'SET' ( ( '' | VariableAssignment ) ( ',' VariableAssignment )* | 'PASSWORD' ( 'FOR' Username )? '=' PasswordOpt | ( 'GLOBAL' | 'SESSION' ) 'TRANSACTION' TransactionChar ( ',' TransactionChar )* )

referenced by:


TransactionChar:

TransactionChar
         ::= 'ISOLATION' 'LEVEL' IsolationLevel
           | 'READ' ( 'WRITE' | 'ONLY' )

referenced by:


IsolationLevel:

IsolationLevel
         ::= 'REPEATABLE' 'READ'
           | 'READ' ( 'COMMITTED' | 'UNCOMMITTED' )
           | 'SERIALIZABLE'

referenced by:


VariableAssignment:

VariableAssignment
         ::= ( ( ( 'GLOBAL' | 'SESSION' | 'LOCAL' )? Identifier | 'SYS_VAR' ) '=' | 'USER_VAR' ( '=' | ' ::==' ) ) Expression
           | 'NAMES' CharsetName ( 'COLLATE' StringName )?
           | CharsetKw CharsetName

referenced by:


CharsetName:

CharsetName
         ::= StringName
           | 'BINARY'

referenced by:


Variable:

Variable ::= 'SYS_VAR'
           | 'USER_VAR'

referenced by:


Username:

Username ::= 'string literal' 'AT' 'string literal'

referenced by:


PasswordOpt:

PasswordOpt
         ::= 'string literal'
           | 'PASSWORD' '(' 'string literal' ')'

referenced by:


AdminStmt:

AdminStmt
         ::= 'ADMIN' ( 'SHOW' 'DDL' | 'CHECK' 'TABLE' TableNameList )

referenced by:


ShowStmt:

ShowStmt ::= 'SHOW' ( ShowTargetFilterable ShowLikeOrWhereOpt | ( 'CREATE' 'TABLE' | ( 'INDEX' | 'KEYS' ) 'FROM' ) TableName | 'GRANTS' ( 'FOR' Username )? )

referenced by:


ShowTargetFilterable:

ShowTargetFilterable
         ::= 'ENGINES'
           | 'DATABASES'
           | 'SCHEMAS'
           | 'CHARACTER' 'SET'
           | ( OptFull ( 'TABLES' | ( 'COLUMNS' | 'FIELDS' ) ShowTableAliasOpt ) | 'TABLE' 'STATUS' | 'TRIGGERS' ) ShowDatabaseNameOpt
           | 'WARNINGS'
           | GlobalScope ( 'VARIABLES' | 'STATUS' )
           | 'COLLATION'
           | ( 'PROCEDURE' | 'FUNCTION' ) 'STATUS'

referenced by:


ShowLikeOrWhereOpt:

ShowLikeOrWhereOpt
         ::= ''
           | 'LIKE' PrimaryExpression
           | 'WHERE' Expression

referenced by:


GlobalScope:

GlobalScope
         ::= ''
           | 'GLOBAL'
           | 'SESSION'

referenced by:


OptFull:

OptFull  ::= ''
           | 'FULL'

referenced by:


ShowDatabaseNameOpt:

ShowDatabaseNameOpt
         ::= ''
           | ( 'FROM' | 'IN' ) DBName

referenced by:


ShowTableAliasOpt:

ShowTableAliasOpt
         ::= ( 'FROM' | 'IN' ) TableName

referenced by:


FlushStmt:

FlushStmt
         ::= 'FLUSH' NoWriteToBinLogAliasOpt TableOrTables TableNameListOpt WithReadLockOpt

referenced by:


NoWriteToBinLogAliasOpt:

NoWriteToBinLogAliasOpt
         ::= ''
           | 'NO_WRITE_TO_BINLOG'
           | 'LOCAL'

referenced by:


TableNameListOpt:

TableNameListOpt
         ::= ''
           | TableNameList

referenced by:


WithReadLockOpt:

WithReadLockOpt
         ::= ''
           | 'WITH' 'READ' 'LOCK'

referenced by:


Statement:

Statement
         ::= ''
           | AdminStmt
           | AlterTableStmt
           | AnalyzeTableStmt
           | BeginTransactionStmt
           | BinlogStmt
           | 'COMMIT'
           | DeallocateStmt
           | DeleteFromStmt
           | ExecuteStmt
           | ExplainStmt
           | CreateDatabaseStmt
           | CreateIndexStmt
           | CreateTableStmt
           | CreateUserStmt
           | DoStmt
           | DropDatabaseStmt
           | DropIndexStmt
           | DropTableStmt
           | FlushStmt
           | GrantStmt
           | InsertIntoStmt
           | LoadDataStmt
           | PreparedStmt
           | 'ROLLBACK'
           | ReplaceIntoStmt
           | SelectStmt
           | UnionStmt
           | SetStmt
           | ShowStmt
           | TruncateTableStmt
           | UpdateStmt
           | UseStmt
           | SubSelect
           | UnlockTablesStmt
           | LockTablesStmt

referenced by:


ExplainableStmt:

ExplainableStmt
         ::= SelectStmt
           | DeleteFromStmt
           | UpdateStmt
           | InsertIntoStmt
           | ReplaceIntoStmt

referenced by:


Constraint:

Constraint
         ::= ConstraintKeywordOpt ConstraintElem

referenced by:


TableElement:

TableElement
         ::= ColumnDef
           | Constraint
           | 'CHECK' '(' Expression ')'

referenced by:


TableOption:

TableOption
         ::= ( 'ENGINE' '='? | 'COMPRESSION' EqOpt ) Identifier
           | DefaultKwdOpt ( CharsetKw EqOpt CharsetName | 'COLLATE' EqOpt StringName )
           | ( 'AUTO_INCREMENT' '=' | ( 'AVG_ROW_LENGTH' | 'CHECKSUM' | 'KEY_BLOCK_SIZE' | 'MAX_ROWS' | 'MIN_ROWS' | 'DELAY_KEY_WRITE' ) EqOpt ) 'integer literal'
           | ( 'COMMENT' | 'CONNECTION' | 'PASSWORD' ) EqOpt 'string literal'
           | RowFormat
           | 'STATS_PERSISTENT' EqOpt StatsPersistentVal

referenced by:


StatsPersistentVal:

StatsPersistentVal
         ::= 'DEFAULT'
           | 'integer literal'

referenced by:


TableOptionListOpt:

TableOptionListOpt
         ::= ''
           | TableOption ( ','? TableOption )*

referenced by:


OptTable:

OptTable ::= ''
           | 'TABLE'

referenced by:


TruncateTableStmt:

TruncateTableStmt
         ::= 'TRUNCATE' OptTable TableName

referenced by:


RowFormat:

RowFormat
         ::= 'ROW_FORMAT' EqOpt ( 'DEFAULT' | 'DYNAMIC' | 'FIXED' | 'COMPRESSED' | 'REDUNDANT' | 'COMPACT' )

referenced by:


Type:

Type     ::= NumericType
           | StringType
           | DateAndTimeType

referenced by:


NumericType:

NumericType
         ::= ( IntegerType OptFieldLen | ( FixedPointType | FloatingPointType ) FloatOpt ) '' FieldOpt*
           | 'BIT' OptFieldLen

referenced by:


IntegerType:

IntegerType
         ::= 'TINYINT'
           | 'SMALLINT'
           | 'MEDIUMINT'
           | 'INT'
           | 'INTEGER'
           | 'BIGINT'
           | 'BOOL'
           | 'BOOLEAN'

referenced by:


OptInteger:

OptInteger
         ::= ''
           | 'INTEGER'

referenced by:


FixedPointType:

FixedPointType
         ::= 'DECIMAL'
           | 'NUMERIC'

referenced by:


FloatingPointType:

FloatingPointType
         ::= 'float'
           | 'REAL'
           | 'DOUBLE' 'PRECISION'?

referenced by:


StringType:

StringType
         ::= ( ( NationalOpt ( 'CHAR' FieldLen? | 'VARCHAR' FieldLen ) | TextType ) OptBinary | ( 'ENUM' | 'SET' ) '(' 'string literal' ( ',' 'string literal' )* ')' ) OptCharset OptCollate
           | 'BINARY' OptFieldLen
           | 'VARBINARY' FieldLen
           | BlobType

referenced by:


NationalOpt:

NationalOpt
         ::= ''
           | 'NATIONAL'

referenced by:


BlobType:

BlobType ::= 'TINYBLOB'
           | 'BLOB' OptFieldLen
           | 'MEDIUMBLOB'
           | 'LONGBLOB'

referenced by:


TextType:

TextType ::= 'TINYTEXT'
           | 'TEXT' OptFieldLen
           | 'MEDIUMTEXT'
           | 'LONGTEXT'

referenced by:


DateAndTimeType:

DateAndTimeType
         ::= 'DATE'
           | ( 'DATETIME' | 'TIMESTAMP' | 'TIME' | 'YEAR' ) OptFieldLen

referenced by:


FieldLen:

FieldLen ::= '(' 'integer literal' ')'

referenced by:


OptFieldLen:

OptFieldLen
         ::= ''
           | FieldLen

referenced by:


FieldOpt:

FieldOpt ::= 'UNSIGNED'
           | 'ZEROFILL'

referenced by:


FloatOpt:

FloatOpt ::= ''
           | FieldLen
           | Precision

referenced by:


Precision:

Precision
         ::= '(' 'integer literal' ',' 'integer literal' ')'

referenced by:


OptBinary:

OptBinary
         ::= ''
           | 'BINARY'

referenced by:


OptCharset:

OptCharset
         ::= ''
           | CharsetKw CharsetName

referenced by:


CharsetKw:

CharsetKw
         ::= 'CHARACTER' 'SET'
           | 'CHARSET'

referenced by:


OptCollate:

OptCollate
         ::= ''
           | 'COLLATE' StringName

referenced by:


StringName:

StringName
         ::= 'string literal'
           | Identifier

referenced by:


UpdateStmt:

UpdateStmt
         ::= 'UPDATE' LowPriorityOptional IgnoreOptional ( TableRef 'SET' AssignmentList WhereClauseOptional OrderByOptional LimitClause | TableRefs 'SET' AssignmentList WhereClauseOptional )

referenced by:


UseStmt:

UseStmt  ::= 'USE' DBName

referenced by:


WhereClause:

WhereClause
         ::= 'WHERE' Expression

referenced by:


WhereClauseOptional:

WhereClauseOptional
         ::= ''
           | WhereClause

referenced by:


CreateUserStmt:

CreateUserStmt
         ::= 'CREATE' 'USER' IfNotExists UserSpecList

referenced by:


UserSpec:

UserSpec ::= Username AuthOption

referenced by:


UserSpecList:

UserSpecList
         ::= UserSpec ( ',' UserSpec )*

referenced by:


AuthOption:

AuthOption
         ::= ''
           | 'IDENTIFIED' 'BY' 'PASSWORD'? 'string literal'

referenced by:


GrantStmt:

GrantStmt
         ::= 'GRANT' PrivElem ( ',' PrivElem )* 'ON' ObjectType PrivLevel 'TO' UserSpecList

referenced by:


PrivElem:

PrivElem ::= PrivType ( '(' ColumnNameList ')' )?

referenced by:


PrivType:

PrivType ::= 'ALL' 'PRIVILEGES'?
           | 'ALTER'
           | 'CREATE' 'USER'?
           | 'DELETE'
           | 'DROP'
           | 'EXECUTE'
           | 'INDEX'
           | 'INSERT'
           | 'SELECT'
           | 'SHOW' 'DATABASES'
           | 'UPDATE'
           | 'GRANT' 'OPTION'

referenced by:


ObjectType:

ObjectType
         ::= ''
           | 'TABLE'

referenced by:


PrivLevel:

PrivLevel
         ::= '*' ( '.' '*' )?
           | Identifier ( '.' ( '*' | Identifier ) )?

referenced by:


LoadDataStmt:

LoadDataStmt
         ::= 'LOAD' 'DATA' LocalOpt 'INFILE' 'string literal' 'INTO' 'TABLE' TableName Fields Lines

referenced by:


LocalOpt:

LocalOpt ::= ''
           | 'LOCAL'

referenced by:


Fields:

Fields   ::= ''
           | FieldsOrColumns FieldsTerminated Enclosed Escaped

referenced by:


FieldsOrColumns:

FieldsOrColumns
         ::= 'FIELDS'
           | 'COLUMNS'

referenced by:


FieldsTerminated:

FieldsTerminated
         ::= ''
           | 'TERMINATED' 'BY' 'string literal'

referenced by:


Enclosed:

Enclosed ::= ''
           | 'ENCLOSED' 'BY' 'string literal'

referenced by:


Escaped:

Escaped  ::= ''
           | 'ESCAPED' 'BY' 'string literal'

referenced by:


Lines:

Lines    ::= ''
           | 'LINES' Starting LinesTerminated

referenced by:


Starting:

Starting ::= ''
           | 'STARTING' 'BY' 'string literal'

referenced by:


LinesTerminated:

LinesTerminated
         ::= ''
           | 'TERMINATED' 'BY' 'string literal'

referenced by:


UnlockTablesStmt:

UnlockTablesStmt
         ::= 'UNLOCK' 'TABLES'

referenced by:


LockTablesStmt:

LockTablesStmt
         ::= 'LOCK' 'TABLES' TableLock ( ',' TableLock )*

referenced by:


TableLock:

TableLock
         ::= TableName LockType

referenced by:


LockType:

LockType ::= 'READ' 'LOCAL'?
           | 'WRITE'

referenced by:



  ... generated by Railroad Diagram Generator