1 From http://epoch.cs.berkeley.edu:8000/sequoia/dba/montage/FAQ/SQL.html
2 by Jean Anderson (jta@postgres.berkeley.edu)
4 What are the SQL reserved words?
6 I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
7 SQL3 words are not set in stone, but you'd do well to avoid them.
11 AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
12 COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
13 EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
14 NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
15 PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
16 REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
17 ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
18 SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
19 UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
21 From sql1992.txt (Annex E):
23 ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
26 What are the SQL reserved words?
28 I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
29 SQL3 words are not set in stone, but you'd do well to avoid them.
33 AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
34 COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
35 EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
36 NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
37 PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
38 REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
39 ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
40 SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
41 UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
43 From sql1992.txt (Annex E):
45 ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
48 What are the SQL reserved words?
50 I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
51 SQL3 words are not set in stone, but you'd do well to avoid them.
55 AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
56 COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
57 EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
58 NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
59 PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
60 REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
61 ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
62 SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
63 UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
65 From sql1992.txt (Annex E):
67 ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
68 BIT, BIT_LENGTH, BOTH, CASCADE, CASCADED, CASE, CAST, CATALOG,
69 CHAR_LENGTH, CHARACTER_LENGTH, COALESCE, COLLATE, COLLATION, COLUMN,
70 CONNECT, CONNECTION, CONSTRAINT, CONSTRAINTS, CONVERT, CORRESPONDING,
71 CROSS, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER,
72 DATE, DAY, DEALLOCATE, DEFERRABLE, DEFERRED, DESCRIBE, DESCRIPTOR,
73 DIAGNOSTICS, DISCONNECT, DOMAIN, DROP, ELSE, END-EXEC, EXCEPT,
74 EXCEPTION, EXECUTE, EXTERNAL, EXTRACT, FALSE, FIRST, FULL, GET,
75 GLOBAL, HOUR, IDENTITY, IMMEDIATE, INITIALLY, INNER, INPUT,
76 INSENSITIVE, INTERSECT, INTERVAL, ISOLATION, JOIN, LAST, LEADING,
77 LEFT, LEVEL, LOCAL, LOWER, MATCH, MINUTE, MONTH, NAMES, NATIONAL,
78 NATURAL, NCHAR, NEXT, NO, NULLIF, OCTET_LENGTH, ONLY, OUTER, OUTPUT,
79 OVERLAPS, PAD, PARTIAL, POSITION, PREPARE, PRESERVE, PRIOR, READ,
80 RELATIVE, RESTRICT, REVOKE, RIGHT, ROWS, SCROLL, SECOND, SESSION,
81 SESSION_USER, SIZE, SPACE, SQLSTATE, SUBSTRING, SYSTEM_USER,
82 TEMPORARY, THEN, TIME, TIMESTAMP, TIMEZONE_HOUR, TIMEZONE_MINUTE,
83 TRAILING, TRANSACTION, TRANSLATE, TRANSLATION, TRIM, TRUE, UNKNOWN,
84 UPPER, USAGE, USING, VALUE, VARCHAR, VARYING, WHEN, WRITE, YEAR, ZONE
86 From sql3part2.txt (Annex E)
88 ACTION, ACTOR, AFTER, ALIAS, ASYNC, ATTRIBUTES, BEFORE, BOOLEAN,
89 BREADTH, COMPLETION, CURRENT_PATH, CYCLE, DATA, DEPTH, DESTROY,
90 DICTIONARY, EACH, ELEMENT, ELSEIF, EQUALS, FACTOR, GENERAL, HOLD,
91 IGNORE, INSTEAD, LESS, LIMIT, LIST, MODIFY, NEW, NEW_TABLE, NO,
92 NONE, OFF, OID, OLD, OLD_TABLE, OPERATION, OPERATOR, OPERATORS,
93 PARAMETERS, PATH, PENDANT, POSTFIX, PREFIX, PREORDER, PRIVATE,
94 PROTECTED, RECURSIVE, REFERENCING, REPLACE, ROLE, ROUTINE, ROW,
95 SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SESSION, SIMILAR, SPACE,
96 SQLEXCEPTION, SQLWARNING, START, STATE, STRUCTURE, SYMBOL, TERM,
97 TEST, THERE, TRIGGER, TYPE, UNDER, VARIABLE, VIRTUAL, VISIBLE,
100 sql3part4.txt (ANNEX E):
102 CALL, DO, ELSEIF, EXCEPTION, IF, LEAVE, LOOP, OTHERS, RESIGNAL,
103 RETURN, RETURNS, SIGNAL, TUPLE, WHILE
105 from http://dev.mysql.com/doc/refman/5.6/en/reserved-words.html
110 BEFORE BETWEEN BIGINT
114 CHARACTER CHECK COLLATE
115 COLUMN CONDITION CONSTRAINT
116 CONTINUE CONVERT CREATE
117 CROSS CURRENT_DATE CURRENT_TIME
118 CURRENT_TIMESTAMP CURRENT_USER CURSOR
119 DATABASE DATABASES DAY_HOUR
120 DAY_MICROSECOND DAY_MINUTE DAY_SECOND
122 DEFAULT DELAYED DELETE
123 DESC DESCRIBE DETERMINISTIC
124 DISTINCT DISTINCTROW DIV
127 ENCLOSED ESCAPED EXISTS
131 FOREIGN FROM FULLTEXT
133 HAVING HIGH_PRIORITY HOUR_MICROSECOND
134 HOUR_MINUTE HOUR_SECOND IF
135 IGNORE IGNORE_SERVER_IDS IN
137 INOUT INSENSITIVE INSERT
140 INTEGER INTERVAL INTO
146 LOCALTIMESTAMP LOCK LONG
147 LONGBLOB LONGTEXT LOOP
148 LOW_PRIORITY MASTER_HEARTBEAT_PERIOD MASTER_SSL_VERIFY_SERVER_CERT
149 MATCH MAXVALUE MEDIUMBLOB
150 MEDIUMINT MEDIUMTEXT MIDDLEINT
151 MINUTE_MICROSECOND MINUTE_SECOND MOD
153 NO_WRITE_TO_BINLOG NULL NUMERIC
157 PRECISION PRIMARY PROCEDURE
159 READS READ_WRITE REAL
160 REFERENCES REGEXP RELEASE
161 RENAME REPEAT REPLACE
162 REQUIRE RESIGNAL RESTRICT
165 SECOND_MICROSECOND SELECT SENSITIVE
169 SQLEXCEPTION SQLSTATE SQLWARNING
170 SQL_BIG_RESULT SQL_CALC_FOUND_ROWS SQL_SMALL_RESULT
171 SSL STARTING STRAIGHT_JOIN
172 TABLE TERMINATED THEN
173 TINYBLOB TINYINT TINYTEXT
176 UNIQUE UNLOCK UNSIGNED
178 USING UTC_DATE UTC_TIME
179 UTC_TIMESTAMP VALUES VARBINARY
180 VARCHAR VARCHARACTER VARYING
185 The following are new reserved words in MySQL 5.5:
186 GENERAL IGNORE_SERVER_IDS MASTER_HEARTBEAT_PERIOD
187 MAXVALUE RESIGNAL SIGNAL
190 MySQL permits some keywords to be used as unquoted identifiers because many people previously used them. Examples are those in the following list: