# Keywords

This article introduces the keywords in TiDB, the differences between reserved words and non-reserved words and summarizes all keywords for the query.

Keywords are words that have special meanings in SQL statements, such as `SELECT`, `UPDATE`, and `DELETE`. Some of them can be used as identifiers directly, which are called non-reserved keywords. Some of them require special treatment before being used as identifiers, which are called reserved keywords.

To use the reserved keywords as identifiers, you must enclose them in backticks ```:

``````CREATE TABLE select (a INT);
``````
``````ERROR 1105 (HY000): line 0 column 19 near " (a INT)" (total length 27)
``````
``````CREATE TABLE `select` (a INT);
``````
``````Query OK, 0 rows affected (0.09 sec)
``````

The non-reserved keywords do not require backticks, such as `BEGIN` and `END`, which can be successfully used as identifiers in the following statement:

``````CREATE TABLE `select` (BEGIN int, END int);
``````
``````Query OK, 0 rows affected (0.09 sec)
``````

In the special case, the reserved keywords do not need backticks if they are used with the `.` delimiter:

``````CREATE TABLE test.select (BEGIN int, END int);
``````
``````Query OK, 0 rows affected (0.08 sec)
``````

The following list shows the keywords in TiDB. Reserved keywords are marked with `(R)`. Reserved keywords for Window Functions are marked with `(R-Window)`:

A
• ACCOUNT
• ACTION
• AFTER
• AGAINST
• AGO
• ALGORITHM
• ALL (R)
• ALTER (R)
• ALWAYS
• ANALYZE (R)
• AND (R)
• ANY
• AS (R)
• ASC (R)
• ASCII
• AUTO_ID_CACHE
• AUTO_INCREMENT
• AUTO_RANDOM
• AUTO_RANDOM_BASE
• AVG
• AVG_ROW_LENGTH
B
• BACKEND
• BACKUP
• BACKUPS
• BEGIN
• BETWEEN (R)
• BIGINT (R)
• BINARY (R)
• BINDING
• BINDINGS
• BINLOG
• BIT
• BLOB (R)
• BLOCK
• BOOL
• BOOLEAN
• BOTH (R)
• BTREE
• BUCKETS (R)
• BUILTINS (R)
• BY (R)
• BYTE
C
• CACHE
• CANCEL (R)
• CAPTURE
• CASE (R)
• CHAIN
• CHANGE (R)
• CHAR (R)
• CHARACTER (R)
• CHARSET
• CHECK (R)
• CHECKPOINT
• CHECKSUM
• CIPHER
• CLEANUP
• CLIENT
• CMSKETCH (R)
• COALESCE
• COLLATE (R)
• COLLATION
• COLUMN (R)
• COLUMNS
• COLUMN_FORMAT
• COMMENT
• COMMIT
• COMMITTED
• COMPACT
• COMPRESSED
• COMPRESSION
• CONCURRENCY
• CONFIG
• CONNECTION
• CONSISTENT
• CONSTRAINT (R)
• CONTEXT
• CONVERT (R)
• CPU
• CREATE (R)
• CROSS (R)
• CSV_BACKSLASH_ESCAPE
• CSV_DELIMITER
• CSV_NOT_NULL
• CSV_NULL
• CSV_SEPARATOR
• CSV_TRIM_LAST_SEPARATORS
• CUME_DIST (R-Window)
• CURRENT
• CURRENT_DATE (R)
• CURRENT_ROLE (R)
• CURRENT_TIME (R)
• CURRENT_TIMESTAMP (R)
• CURRENT_USER (R)
• CYCLE
D
• DATA
• DATABASE (R)
• DATABASES (R)
• DATE
• DATETIME
• DAY
• DAY_HOUR (R)
• DAY_MICROSECOND (R)
• DAY_MINUTE (R)
• DAY_SECOND (R)
• DDL (R)
• DEALLOCATE
• DECIMAL (R)
• DEFAULT (R)
• DEFINER
• DELAYED (R)
• DELAY_KEY_WRITE
• DELETE (R)
• DENSE_RANK (R-Window)
• DEPTH (R)
• DESC (R)
• DESCRIBE (R)
• DIRECTORY
• DISABLE
• DISK
• DISTINCT (R)
• DISTINCTROW (R)
• DIV (R)
• DO
• DOUBLE (R)
• DRAINER (R)
• DROP (R)
• DUAL (R)
• DUPLICATE
• DYNAMIC
E
• ELSE (R)
• ENABLE
• ENCLOSED (R)
• ENCRYPTION
• END
• ENFORCED
• ENGINE
• ENGINES
• ENUM
• ERROR
• ERRORS
• ESCAPE
• ESCAPED (R)
• EVENT
• EVENTS
• EVOLVE
• EXCEPT (R)
• EXCHANGE
• EXCLUSIVE
• EXECUTE
• EXISTS (R)
• EXPANSION
• EXPIRE
• EXPLAIN (R)
• EXTENDED
F
• FALSE (R)
• FAULTS
• FIELDS
• FILE
• FIRST
• FIRST_VALUE (R-Window)
• FIXED
• FLOAT (R)
• FLUSH
• FOLLOWING
• FOR (R)
• FORCE (R)
• FOREIGN (R)
• FORMAT
• FROM (R)
• FULL
• FULLTEXT (R)
• FUNCTION
G
• GENERAL
• GENERATED (R)
• GLOBAL
• GRANT (R)
• GRANTS
• GROUP (R)
• GROUPS (R-Window)
H
• HASH
• HAVING (R)
• HIGH_PRIORITY (R)
• HISTORY
• HOSTS
• HOUR
• HOUR_MICROSECOND (R)
• HOUR_MINUTE (R)
• HOUR_SECOND (R)
I
• IDENTIFIED
• IF (R)
• IGNORE (R)
• IMPORT
• IMPORTS
• IN (R)
• INCREMENT
• INCREMENTAL
• INDEX (R)
• INDEXES
• INFILE (R)
• INNER (R)
• INSERT (R)
• INSERT_METHOD
• INSTANCE
• INT (R)
• INT1 (R)
• INT2 (R)
• INT3 (R)
• INT4 (R)
• INT8 (R)
• INTEGER (R)
• INTERVAL (R)
• INTO (R)
• INVISIBLE
• INVOKER
• IO
• IPC
• IS (R)
• ISOLATION
• ISSUER
J
• JOB (R)
• JOBS (R)
• JOIN (R)
• JSON
K
• KEY (R)
• KEYS (R)
• KEY_BLOCK_SIZE
• KILL (R)
L
• LABELS
• LAG (R-Window)
• LANGUAGE
• LAST
• LASTVAL
• LAST_BACKUP
• LAST_VALUE (R-Window)
• LEFT (R)
• LESS
• LEVEL
• LIKE (R)
• LIMIT (R)
• LINEAR (R)
• LINES (R)
• LIST
• LOCAL
• LOCALTIME (R)
• LOCALTIMESTAMP (R)
• LOCATION
• LOCK (R)
• LOGS
• LONG (R)
• LONGBLOB (R)
• LONGTEXT (R)
• LOW_PRIORITY (R)
M
• MASTER
• MATCH (R)
• MAXVALUE (R)
• MAX_CONNECTIONS_PER_HOUR
• MAX_IDXNUM
• MAX_MINUTES
• MAX_QUERIES_PER_HOUR
• MAX_ROWS
• MAX_USER_CONNECTIONS
• MB
• MEDIUMBLOB (R)
• MEDIUMINT (R)
• MEDIUMTEXT (R)
• MEMORY
• MERGE
• MICROSECOND
• MINUTE
• MINUTE_MICROSECOND (R)
• MINUTE_SECOND (R)
• MINVALUE
• MIN_ROWS
• MOD (R)
• MODE
• MODIFY
• MONTH
N
• NAMES
• NATIONAL
• NATURAL (R)
• NCHAR
• NEVER
• NEXT
• NEXTVAL
• NO
• NOCACHE
• NOCYCLE
• NODEGROUP
• NODE_ID (R)
• NODE_STATE (R)
• NOMAXVALUE
• NOMINVALUE
• NONE
• NOT (R)
• NOWAIT
• NO_WRITE_TO_BINLOG (R)
• NTH_VALUE (R-Window)
• NTILE (R-Window)
• NULL (R)
• NULLS
• NUMERIC (R)
• NVARCHAR
O
• OFFSET
• ON (R)
• ONLINE
• ONLY
• ON_DUPLICATE
• OPEN
• OPTIMISTIC (R)
• OPTIMIZE (R)
• OPTION (R)
• OPTIONALLY (R)
• OR (R)
• ORDER (R)
• OUTER (R)
• OUTFILE (R)
• OVER (R-Window)
P
• PACK_KEYS
• PAGE
• PARSER
• PARTIAL
• PARTITION (R)
• PARTITIONING
• PARTITIONS
• PERCENT_RANK (R-Window)
• PER_DB
• PER_TABLE
• PESSIMISTIC (R)
• PLUGINS
• PRECEDING
• PRECISION (R)
• PREPARE
• PRE_SPLIT_REGIONS
• PRIMARY (R)
• PRIVILEGES
• PROCEDURE (R)
• PROCESS
• PROCESSLIST
• PROFILE
• PROFILES
• PUMP (R)
Q
• QUARTER
• QUERIES
• QUERY
• QUICK
R
• RANGE (R)
• RANK (R-Window)
• RATE_LIMIT
• REAL (R)
• REBUILD
• RECOVER
• REDUNDANT
• REFERENCES (R)
• REGEXP (R)
• REGION (R)
• REGIONS (R)
• RELEASE (R)
• REMOVE
• RENAME (R)
• REORGANIZE
• REPAIR
• REPEAT (R)
• REPEATABLE
• REPLACE (R)
• REPLICA
• REPLICATION
• REQUIRE (R)
• RESPECT
• RESTORE
• RESTORES
• RESTRICT (R)
• REVERSE
• REVOKE (R)
• RIGHT (R)
• RLIKE (R)
• ROLE
• ROLLBACK
• ROUTINE
• ROW (R)
• ROWS (R-Window)
• ROW_COUNT
• ROW_FORMAT
• ROW_NUMBER (R-Window)
• RTREE
S
• SAMPLES (R)
• SECOND
• SECONDARY_ENGINE
• SECOND_MICROSECOND (R)
• SECURITY
• SELECT (R)
• SEND_CREDENTIALS_TO_TIKV
• SEPARATOR
• SEQUENCE
• SERIAL
• SERIALIZABLE
• SESSION
• SET (R)
• SETVAL
• SHARD_ROW_ID_BITS
• SHARE
• SHARED
• SHOW (R)
• SHUTDOWN
• SIGNED
• SIMPLE
• SKIP_SCHEMA_FILES
• SLAVE
• SLOW
• SMALLINT (R)
• SNAPSHOT
• SOME
• SOURCE
• SPATIAL (R)
• SPLIT (R)
• SQL (R)
• SQL_BIG_RESULT (R)
• SQL_BUFFER_RESULT
• SQL_CACHE
• SQL_CALC_FOUND_ROWS (R)
• SQL_NO_CACHE
• SQL_SMALL_RESULT (R)
• SQL_TSI_DAY
• SQL_TSI_HOUR
• SQL_TSI_MINUTE
• SQL_TSI_MONTH
• SQL_TSI_QUARTER
• SQL_TSI_SECOND
• SQL_TSI_WEEK
• SQL_TSI_YEAR
• SSL (R)
• START
• STARTING (R)
• STATS (R)
• STATS_AUTO_RECALC
• STATS_BUCKETS (R)
• STATS_HEALTHY (R)
• STATS_HISTOGRAMS (R)
• STATS_META (R)
• STATS_PERSISTENT
• STATS_SAMPLE_PAGES
• STATUS
• STORAGE
• STORED (R)
• STRAIGHT_JOIN (R)
• STRICT_FORMAT
• SUBJECT
• SUBPARTITION
• SUBPARTITIONS
• SUPER
• SWAPS
• SWITCHES
• SYSTEM_TIME
T
• TABLE (R)
• TABLES
• TABLESPACE
• TABLE_CHECKSUM
• TEMPORARY
• TEMPTABLE
• TERMINATED (R)
• TEXT
• THAN
• THEN (R)
• TIDB (R)
• TIFLASH (R)
• TIKV_IMPORTER
• TIME
• TIMESTAMP
• TINYBLOB (R)
• TINYINT (R)
• TINYTEXT (R)
• TO (R)
• TOPN (R)
• TRACE
• TRAILING (R)
• TRANSACTION
• TRIGGER (R)
• TRIGGERS
• TRUE (R)
• TRUNCATE
• TYPE
U
• UNBOUNDED
• UNCOMMITTED
• UNDEFINED
• UNICODE
• UNION (R)
• UNIQUE (R)
• UNKNOWN
• UNLOCK (R)
• UNSIGNED (R)
• UPDATE (R)
• USAGE (R)
• USE (R)
• USER
• USING (R)
• UTC_DATE (R)
• UTC_TIME (R)
• UTC_TIMESTAMP (R)
V
• VALIDATION
• VALUE
• VALUES (R)
• VARBINARY (R)
• VARCHAR (R)
• VARCHARACTER (R)
• VARIABLES
• VARYING (R)
• VIEW
• VIRTUAL (R)
• VISIBLE
W
• WARNINGS
• WEEK
• WEIGHT_STRING
• WHEN (R)
• WHERE (R)
• WIDTH (R)
• WINDOW (R-Window)
• WITH (R)
• WITHOUT
• WRITE (R)
X
• X509
• XOR (R)
Y
• YEAR
• YEAR_MONTH (R)
Z
• ZEROFILL (R)
{"ft_lang_label":"__label__en","ft_lang_prob":0.51301455,"math_prob":0.73405576,"size":16109,"snap":"2022-27-2022-33","text_gpt3_token_len":5178,"char_repetition_ratio":0.15380317,"word_repetition_ratio":0.008938148,"special_character_ratio":0.27990565,"punctuation_ratio":0.021999044,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9950865,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-06-28T03:34:18Z\",\"WARC-Record-ID\":\"<urn:uuid:bf540640-4b09-4c38-9e40-87adefe46baa>\",\"Content-Length\":\"154290\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d7a1cd62-2f6a-46f9-9e95-3522b6631450>\",\"WARC-Concurrent-To\":\"<urn:uuid:cfb63149-4e97-49c7-97b5-229a26b1e0ae>\",\"WARC-IP-Address\":\"107.150.97.56\",\"WARC-Target-URI\":\"https://docs.pingcap.com/tidb/v5.4/keywords/\",\"WARC-Payload-Digest\":\"sha1:5G3KKZ25EWZAXTUUTJ4OY354V7QSRPUQ\",\"WARC-Block-Digest\":\"sha1:DXBOBMS42V55SGQTUENDANSLIOYJREJB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656103347800.25_warc_CC-MAIN-20220628020322-20220628050322-00536.warc.gz\"}"}