O'Reilly    
 Published on O'Reilly (http://oreilly.com/)
 See this if you're having trouble printing code examples


Shared and Platform-Specific Keywords: Appendix A - SQL in a Nutshell

by Chris Grover

The following tables display the keywords in the ANSI standard, and in the four platform-specific implementations of SQL that are discussed in this book, with the Sybase Adaptive Server. The keyword tables appear in the following order:

SQL in a Nutshell book cover

This excerpt is from SQL in a Nutshell, Third Edition . The essential reference to the SQL language used in today's most popular database products, this new edition of SQL in a Nutshell clearly documents every SQL command according to the latest ANSI standard. It also details how these commands are implemented in the Microsoft SQL Server 2008 and Oracle 11g commercial database packages, and the MySQL 5.1 and PostgreSQL 8.3 open source database products.

buy button
  • Shared keywords

  • SQL2003 keywords

  • MySQL keywords

  • Oracle keywords

  • PostgreSQL keywords

  • SQL Server keywords

Table A.1. Shared keywords

ADD

ALL

ALTER

AND

AS

ASC

BY

CHECK

COLUMN

CREATE

DATE

DEFAULT

DELETE

DESC

DROP

FOR

FROM

IN

INTO

IS

LIKE

NOT

NULL

ON

OR

ORDER

REVOKE

SELECT

SET

TABLE

THEN

TO

UNIQUE

UPDATE

WITH

 

Table A.2. SQL2003 keywords

ABSOLUTE

ACTION

ADD

ADMIN

AFTER

AGGREGATE

ALIAS

ALL

ALLOCATE

ALTER

AND

ANY

ARE

ARRAY

AS

ASC

ASSERTION

AT

ATOMIC

AUTHORIZATION

BEFORE

BEGIN

BIGINT

BINARY

BIT

BLOB

BOOLEAN

BOTH

BREADTH

BY

CALL

CASCADE

CASCADED

CASE

CAST

CATALOG

CHAR

CHARACTER

CHECK

CLASS

CLOB

CLOSE

COLLATE

COLLATION

COLLECT

COLUMN

COMMIT

COMPLETION

CONDITION

CONNECT

CONNECTION

CONSTRAINT

CONSTRAINTS

CONSTRUCTOR

CONTAINS

CONTINUE

CORRESPONDING

CREATE

CROSS

CUBE

CURRENT

CURRENT_DATE

CURRENT_PATH

CURRENT_ROLE

CURRENT_TIME

CURRENT_TIMESTAMP

CURRENT_USER

CURSOR

CYCLE

DATA

DATALINK

DATE

DAY

DEALLOCATE

DEC

DECIMAL

DECLARE

DEFAULT

DEFERRABLE

DELETE

DEPTH

DEREF

DESC

DESCRIPTOR

DESTRUCTOR

DIAGNOSTICS

DICTIONARY

DISCONNECT

DO

DOMAIN

DOUBLE

DROP

ELEMENT

END-EXEC

EQUALS

ESCAPE

EXCEPT

EXCEPTION

EXECUTE

EXIT

EXPAND

EXPANDING

FALSE

FIRST

FLOAT

FOR

FOREIGN

FREE

FROM

FUNCTION

FUSION

GENERAL

GET

GLOBAL

GOTO

GROUP

GROUPING

HANDLER

HASH

HOUR

IDENTITY

IF

IGNORE

IMMEDIATE

IN

INDICATOR

INITIALIZE

INITIALLY

INNER

INOUT

INPUT

INSERT

INT

INTEGER

INTERSECT

INTERSECTION

INTERVAL

INTO

IS

ISOLATION

ITERATE

JOIN

KEY

LANGUAGE

LARGE

LAST

LATERAL

LEADING

LEAVE

LEFT

LESS

LEVEL

LIKE

LIMIT

LOCAL

LOCALTIME

LOCALTIMESTAMP

LOCATOR

LOOP

MATCH

MEMBER

MEETS

MERGE

MINUTE

MODIFIES

MODIFY

MODULE

MONTH

MULTISET

NAMES

NATIONAL

NATURAL

NCHAR

NCLOB

NEW

NEXT

NO

NONE

NORMALIZE

NOT

NULL

NUMERIC

OBJECT

OF

OFF

OLD

ON

ONLY

OPEN

OPERATION

OPTION

OR

ORDER

ORDINALITY

OUT

OUTER

OUTPUT

PAD

PARAMETER

PARAMETERS

PARTIAL

PATH

PERIOD

POSTFIX

PRECEDES

PRECISION

PREFIX

PREORDER

PREPARE

PRESERVE

PRIMARY

PRIOR

PRIVILEGES

PROCEDURE

PUBLIC

READ

READS

REAL

RECURSIVE

REDO

REF

REFERENCES

REFERENCING

RELATIVE

REPEAT

RESIGNAL

RESTRICT

RESULT

RETURN

RETURNS

REVOKE

RIGHT

ROLE

ROLLBACK

ROLLUP

ROUTINE

ROW

ROWS

SAVEPOINT

SCHEMA

SCROLL

SEARCH

SECOND

SECTION

SELECT

SEQUENCE

SESSION

SESSION_USER

SET

SETS

SIGNAL

SIZE

SMALLINT

SPECIFIC

SPECIFICTYPE

SQL

SQLEXCEPTION

SQLSTATE

SQLWARNING

START

STATE

STATIC

STRUCTURE

SUBMULTISET

SUCCEEDS

SUM

SYSTEM_USER

TABLE

TABLESAMPLE

TEMPORARY

TERMINATE

THAN

THEN

TIME

TIMESTAMP

TIMEZONE_HOUR

TIMEZONE_MINUTE

TO

TRAILING

TRANSACTION

TRANSLATION

TREAT

TRIGGER

TRUE

UESCAPE

UNDER

UNDO

UNION

UNIQUE

UNKNOWN

UNTIL

UPDATE

USAGE

USER

USING

VALUE

VALUES

VARCHAR

VARIABLE

VARYING

VIEW

WHEN

WHENEVER

WHERE

WHILE

WITH

WRITE

YEAR

ZONE

   

Table A.3. MySQL keywords

ACCESSIBLE

ADD

ALL

ALTER

ANALYZE

AND

AS

ASC

ASENSITIVE

BEFORE

BETWEEN

BIGINT

BINARY

BLOB

BOTH

BY

CALL

CASCADE

CASE

CHANGE

CHAR

CHARACTER

CHECK

COLLATE

COLUMN

CONDITION

CONSTRAINT

CONTINUE

CONVERT

CREATE

CROSS

CURRENT_DATE

CURRENT_TIME

CURRENT_TIMESTAMP

CURRENT_USER

CURSOR

DATABASE

DATABASES

DAY_HOUR

DAY_MICROSECOND

DAY_MINUTE

DAY_SECOND

DEC

DECIMAL

DECLARE

DEFAULT

DELAYED

DELETE

DESC

DESCRIBE

DETERMINISTIC

DISTINCT

DISTINCTROW

DIV

DOUBLE

DROP

DUAL

EACH

ELSE

ELSEIF

ENCLOSED

ESCAPED

EXISTS

EXIT

EXPLAIN

FALSE

FETCH

FLOAT

FLOAT4

FLOAT8

FOR

FORCE

FOREIGN

FROM

FULLTEXT

GRANT

GROUP

HAVING

HIGH_PRIORITY

HOUR_MICROSECOND

HOUR_MINUTE

HOUR_SECOND

IF

IGNORE

IN

INDEX

INFILE

INNER

INOUT

INSENSITIVE

INSERT

INT

INT1

INT2

INT3

INT4

INT8

INTEGER

INTERVAL

INTO

IS

ITERATE

JOIN

KEY

KEYS

KILL

LEADING

LEAVE

LEFT

LIKE

LIMIT

LINEAR

LINES

LOAD

LOCALTIME

LOCALTIMESTAMP

LOCK

LONG

LONGBLOB

LONGTEXT

LOOP

LOW_PRIORITY

MASTER_SSL_VERIFY_SERVER_CERT

MATCH

MEDIUMBLOB

MEDIUMINT

MEDIUMTEXT

MIDDLEINT

MINUTE_MICROSECOND

MINUTE_SECOND

MOD

MODIFIES

NATURAL

NO_WRITE_TO_BINLOG

NOT

NULL

NUMERIC

ON

OPTIMIZE

OPTION

OPTIONALLY

OR

ORDER

OUT

OUTER

OUTFILE

PRECISION

PRIMARY

PROCEDURE

PURGE

RANGE

READ

READ_ONLY

READ_WRITE

READS

REAL

REFERENCES

REGEXP

RELEASE

RENAME

REPEAT

REPLACE

REQUIRE

RESTRICT

RETURN

REVOKE

RIGHT

RLIKE

SCHEMA

SCHEMAS

SECOND_MICROSECOND

SELECT

SENSITIVE

SEPARATOR

SET

SHOW

SMALLINT

SPATIAL

SPECIFIC

SQL

SQL_BIG_RESULT

SQL_CALC_FOUND_ROWS

SQL_SMALL_RESULT

SQLEXCEPTION

SQLSTATE

SQLWARNING

SSL

STARTING

STRAIGHT_JOIN

TABLE

TERMINATED

THEN

TINYBLOB

TINYINT

TINYTEXT

TO

TRAILING

TRIGGER

TRUE

UNDO

UNION

UNIQUE

UNLOCK

UNSIGNED

UPDATE

USAGE

USE

USING

UTC_DATE

UTC_TIME

UTC_TIMESTAMP

VALUES

VARBINARY

VARCHAR

VARCHARACTER

VARYING

WHEN

WHERE

WHILE

WITH

WRITE

XOR

YEAR_MONTH

ZEROFILL


Table A.4. Oracle keywords

ACCESS

ADD

ALL

ALTER

AND

ANY

AS

ASC

AUDIT

BETWEEN

BY

CHAR

CHECK

CLUSTER

COLUMN

COMMENT

COMPRESS

CONNECT

CREATE

CURRENT

DATE

DECIMAL

DEFAULT

DELETE

DESC

DISTINCT

DROP

ELSE

EXCLUSIVE

EXISTS

FILE

FLOAT

FOR

FROM

GRANT

GROUP

HAVING

IDENTIFIED

IMMEDIATE

IN

INCREMENT

INDEX

INITIAL

INSERT

INTEGER

INTERSECT

INTO

IS

LEVEL

LIKE

LOCK

LONG

MAXEXTENTS

MINUS

MLSLABEL

MODE

MODIFY

NOAUDIT

NOCOMPRESS

NOT

NOWAIT

NULL

NUMBER

OF

OFFLINE

ON

ONLINE

OPTION

OR

ORDER

PCTFREE

PRIOR

PRIVILEGES

PUBLIC

RAW

RENAME

RESOURCE

REVOKE

ROW

ROWID

ROWNUM

ROWS

SELECT

SESSION

SET

SHARE

SIZE

SMALLINT

START

SUCCESSFUL

SYNONYM

SYSDATE

TABLE

THEN

TO

TRIGGER

UID

UNION

UNIQUE

UPDATE

USER

VALIDATE

VALUES

VARCHAR


Table A.5. PostgreSQL keywords

ABORT

ADD

ALL

ALLOCATE

ALTER

ANALYZE

AND

ANY

ARE

AS

ASC

ASSERTION

AT

AUTHORIZATION

AVG

BEGIN

BETWEEN

BINARY

BIT

BIT_LENGTH

BOTH

BY

CASCADE

CASCADED

CASE

CAST

CATALOG

CHAR

CHAR_LENGTH

CHARACTER

CHARACTER_LENGTH

CHECK

CLOSE

CLUSTER

COALESCE

COLLATE

COLLATION

COLUMN

COMMIT

CONNECT

CONNECTION

CONSTRAINT

CONTINUE

CONVERT

COPY

CORRESPONDING

COUNT

CREATE

CROSS

CURRENT

CURRENT_DATE

CURRENT_SESSION

CURRENT_TIME

CURRENT_TIMESTAMP

CURRENT_USER

CURSOR

DATE

DEALLOCATE

DEC

DECIMAL

DECLARE

DEFAULT

DELETE

DESC

DESCRIBE

DESCRIPTOR

DIAGNOSTICS

DISCONNECT

DISTINCT

DO

DOMAIN

DROP

ELSE

END

ESCAPE

EXCEPT

EXCEPTION

EXEC

EXECUTE

EXISTS

EXPLAIN

EXTEND

EXTERNAL

EXTRACT

FALSE

FETCH

FIRST

FLOAT

FOR

FOREIGN

FOUND

FROM

FULL

GET

GLOBAL

GO

GOTO

GRANT

GROUP

HAVING

IDENTITY

IN

INDICATOR

INNER

INPUT

INSERT

INTERSECT

INTERVAL

INTO

IS

JOIN

LAST

LEADING

LEFT

LIKE

LISTEN

LOAD

LOCAL

LOCK

LOWER

MAX

MIN

MODULE

MOVE

NAMES

NATIONAL

NATURAL

NCHAR

NEW

NO

NONE

NOT

NOTIFY

NULL

NULLIF

NUMERIC

OCTET_LENGTH

OFFSET

ON

OPEN

OR

ORDER

OUTER

OUTPUT

OVERLAPS

PARTIAL

POSITION

PRECISION

PREPARE

PRESERVE

PRIMARY

PRIVILEGES

PROCEDURE

PUBLIC

REFERENCES

RESET

REVOKE

RIGHT

ROLLBACK

ROWS

SCHEMA

SECTION

SELECT

SESSION

SESSION_USER

SET

SETOF

SHOW

SIZE

SOME

SQL

SQLCODE

SQLERROR

SQLSTATE

SUBSTRING

SUM

SYSTEM_USER

TABLE

TEMPORARY

THEN

TO

TRAILING

TRANSACTION

TRANSLATE

TRANSLATION

TRIM

TRUE

UNION

UNIQUE

UNKNOWN

UNLISTEN

UNTIL

UPDATE

UPPER

USAGE

USER

USING

VACUUM

VALUE

VALUES

VARCHAR

VARYING

VERBOSE

VIEW

WHEN

WHENEVER

WHERE

WITH

WORK

WRITE

  

< b>Table A.6. SQL Server keywords

ADD

ALL

ALTER

AND

ANY

AS

ASC

AUTHORIZATION

BACKUP

BEGIN

BETWEEN

BREAK

BROWSE

BULK

BY

CASCADE

CASE

CHECK

CHECKPOINT

CLOSE

CLUSTERED

COALESCE

COLLATE

COLUMN

COMMIT

COMPUTE

CONSTRAINT

CONTAINS

CONTAINSTABLE

CONTINUE

CONVERT

CREATE

CROSS

CURRENT

CURRENT_DATE

CURRENT_TIME

CURRENT_TIMESTAMP

CURRENT_USER

CURSOR

DATABASE

DBCC

DEALLOCATE

DECLARE

DEFAULT

DELETE

DENY

DESC

DISK

DISTINCT

DISTRIBUTED

DOUBLE

DROP

DUMP

ELSE

END

ERRLVL

ESCAPE

EXCEPT

EXEC

EXECUTE

EXISTS

EXIT

EXTERNAL

FETCH

FILE

FILLFACTOR

FOR

FOREIGN

FREETEXT

FREETEXTTABLE

FROM

FULL

FUNCTION

GOTO

GRANT

GROUP

HAVING

HOLDLOCK

IDENTITY

IDENTITY_INSERT

IDENTITYCOL

IF

IN

INDEX

INNER

INSERT

INTERSECT

INTO

IS

JOIN

KEY

KILL

LEFT

LIKE

LINENO

LOAD

NATIONAL

NOCHECK

NONCLUSTERED

NOT

NULL

NULLIF

OF

OFF

OFFSETS

ON

OPEN

OPENDATASOURCE

OPENQUERY

OPENROWSET

OPENXML

OPTION

OR

ORDER

OUTER

OVER

PERCENT

PIVOT

PLAN

PRECISION

PRIMARY

PRINT

PROC

PROCEDURE

PUBLIC

RAISERROR

READ

READTEXT

RECONFIGURE

REFERENCES

REPLICATION

RESTORE

RESTRICT

RETURN

REVERT

REVOKE

RIGHT

ROLLBACK

ROWCOUNT

ROWGUIDCOL

RULE

SAVE

SCHEMA

SECURITYAUDIT

SELECT

SESSION_USER

SET

SETUSER

SHUTDOWN

SOME

STATISTICS

SYSTEM_USER

TABLE

TABLESAMPLE

TEXTSIZE

THEN

TO

TOP

TRAN

TRANSACTION

TRIGGER

< /td>

TRUNCATE

TSEQUAL

UNION

UNIQUE

UNPIVOT

UPDATE

UPDATETEXT

USE

USER

VALUES

VARYING

VIEW

WAITFOR

WHEN

WHERE

WHILE

WITH

WRITETEXT

 

If you enjoyed this excerpt, buy a copy of SQL in a Nutshell, Third Edition .

Copyright © 2009 O'Reilly Media, Inc.