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