SQL 入门教程:SQL 保留字

目录汇总:SQL 零基础入门教程

SQL 是由关键字组成的语言,关键字是一些用于执行 SQL 操作的特殊词汇。在命名数据库、表、列和其他数据库对象时,一定不要使用这些关键字。因此,这些关键字是一定要保留的。

本文列出主要 DBMS 中最常用的保留字。请注意以下几点。

  • 关键字随不同的 DBMS 而变化,并非下面的所有关键字都被所有 DBMS 采用。
  • 许多 DBMS 扩展了 SQL 保留字,使其包含专门用于实现的术语。多数 DBMS 专用的关键字未列在下面。
  • 为保证以后的兼容性和可移植性,应避免使用这些保留字,即使它们不是你使用的 DBMS 的保留字。
ABORT ABSOLUTE ACTION
ACTIVE ADD AFTER
ALL ALLOCATE ALTER
ANALYZE AND ANY
ARE AS ASC
ASCENDING ASSERTION AT
AUTHORIZATION AUTO AUTO-INCREMENT
AUTOINC AVG BACKUP
BEFORE BEGIN BETWEEN
BIGINT BINARY BIT
BLOB BOOLEAN BOTH
BREAK BROWSE BULK
BY BYTES CACHE
CALL CASCADE CASCADED
CASE CAST CATALOG
CHANGE CHAR CHARACTER
CHARACTER_LENGTH CHECK CHECKPOINT
CLOSE CLUSTER CLUSTERED
COALESCE COLLATE COLUMN
COLUMNS COMMENT COMMIT
COMMITTED COMPUTE COMPUTED
CONDITIONAL CONFIRM CONNECT
CONNECTION CONSTRAINT CONSTRAINTS
CONTAINING CONTAINS CONTAINSTABLE
CONTINUE CONTROLROW CONVERT
COPY COUNT CREATE
CROSS CSTRING CUBE
CURRENT CURRENT_DATE CURRENT_TIME
CURRENT_TIMESTAMP CURRENT_USER CURSOR
DATABASE DATABASES DATE
DATETIME DAY DBCC
DEALLOCATE DEBUG DEC
DECIMAL DECLARE DEFAULT
DELETE DENY DESC
DESCENDING DESCRIBE DISCONNECT
DISK DISTINCT DISTRIBUTED
DIV DO DOMAIN
DOUBLE DROP DUMMY
DUMP ELSE ELSEIF
ENCLOSED END ERRLVL
ERROREXIT ESCAPE ESCAPED
EXCEPT EXCEPTION EXEC
EXECUTE EXISTS EXIT
EXPLAIN EXTEND EXTERNAL
EXTRACT FALSE FETCH
FIELD FIELDS FILE
FILLFACTOR FILTER FLOAT
FLOPPY FOR FORCE
FOREIGN FOUND FREETEXT
FREETEXTTABLE FROM FULL
FUNCTION GENERATOR GET
GLOBAL GO GOTO
GRANT GROUP HAVING
HOLDLOCK HOUR IDENTITY
IF IN INACTIVE
INDEX INDICATOR INFILE
INNER INOUT INPUT
INSENSITIVE INSERT INT
INTEGER INTERSECT INTERVAL
INTO IS ISOLATION
JOIN KEY KILL
LANGUAGE LAST LEADING
LEFT LENGTH LEVEL
LIKE LIMIT LINENO
LINES LISTEN LOAD
LOCAL LOCK LOGFILE
LONG LOWER MANUAL
MATCH MAX MERGE
MESSAGE MIN MINUTE
MIRROREXIT MODULE MONEY
MONTH MOVE NAMES
NATIONAL NATURAL NCHAR
NEXT NEW NO
NOCHECK NONCLUSTERED NONE
NOT NULL NULLIF
NUMERIC OF OFF
OFFSET OFFSETS ON
ONCE ONLY OPEN
OPTION OR ORDER
OUTER OUTPUT OVER
OVERFLOW OVERLAPS PAD
PAGE PAGES PARAMETER
PARTIAL PASSWORD PERCENT
PERM PERMANENT PIPE
PLAN POSITION PRECISION
PREPARE PRIMARY PRINT
PRIOR PRIVILEGES PROC
PROCEDURE PROCESSEXIT PROTECTED
PUBLIC PURGE RAISERROR
READ READTEXT REAL
REFERENCES REGEXP RELATIVE
RENAME REPEAT REPLACE
REPLICATION REQUIRE RESERV
RESERVING RESET RESTORE
RESTRICT RETAIN RETURN
RETURNS REVOKE RIGHT
ROLLBACK ROLLUP ROWCOUNT
RULE SAVE SAVEPOINT
SCHEMA SECOND SECTION
SEGMENT SELECT SENSITIVE
SEPARATOR SEQUENCE SESSION_USER
SET SETUSER SHADOW
SHARED SHOW SHUTDOWN
SINGULAR SIZE SMALLINT
SNAPSHOT SOME SORT
SPACE SQL SQLCODE
SQLERROR STABILITY STARTING
STARTS STATISTICS SUBSTRING
SUM SUSPEND TABLE
TABLES TEMP TEMPORARY
TEXT TEXTSIZE THEN
TIME TIMESTAMP TO
TOP TRAILING TRAN
TRANSACTION TRANSLATE TRIGGER
TRIM TRUE TRUNCATE
TYPE UNCOMMITTED UNION
UNIQUE UNTIL UPDATE
UPDATETEXT UPPER USAGE
USE USER USING
VALUE VALUES VARCHAR
VARIABLE VARYING VERBOSE
VIEW VOLUME WAIT
WAITFOR WHEN WHERE
WHILE WITH WORK
WRITE WRITETEXT XOR
YEAR ZONE  

(完)

comments powered by Disqus