tencent cloud

TDSQL Boundless

KEYWORDS

Download
Focus Mode
Font Size
Last updated: 2026-05-26 15:08:02

Function

information_schema.KEYWORDS is used to enumerate all SQL keywords recognized by the current instance through SQL queries and to identify which of them are reserved words. This view is commonly used in the following scenarios:
When creating objects such as databases, tables, columns, variables, or aliases, determine whether identifiers need to be enclosed in backticks to avoid conflicts with keywords.
Client tools (such as drivers, ORMs, SQL editors, and data governance platforms) implement SQL highlighting, auto-completion, and syntax validation.
Troubleshoot syntax errors caused by using keywords as identifiers.
The view content is automatically generated by the system at startup and can be queried without any prerequisite operations.

Field Description

Field Name
Type
Description
WORD
VARCHAR(128)
The keyword itself is returned in uppercase, for example, SELECT, ADD, ACCOUNT.
RESERVED
INT
Whether it is a reserved word.
1 indicates a reserved word, which must be enclosed in backticks when the reserved word is used as an identifier.
0 indicates a non-reserved word, which can be used directly as an identifier.

Examples

Query all keywords for the current instance:
tdsql> SELECT * FROM information_schema.KEYWORDS;
+----------------------------------------+----------+
| WORD | RESERVED |
+----------------------------------------+----------+
| ACCESSIBLE | 1 |
| ACCOUNT | 0 |
| ACTION | 0 |
| ADD | 1 |
| ALL | 1 |
| ALTER | 1 |
| ... | ... |
+----------------------------------------+----------+
To query only reserved words, you can filter using the RESERVED field:
tdsql> SELECT WORD FROM information_schema.KEYWORDS WHERE RESERVED = 1 ORDER BY WORD;
Determine whether an identifier (for example, ORDER) is a reserved word:
tdsql> SELECT WORD, RESERVED FROM information_schema.KEYWORDS WHERE WORD = 'ORDER';
+-------+----------+
| WORD | RESERVED |
+-------+----------+
| ORDER | 1 |
+-------+----------+

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback