When this guide is useful
This is for users who want to list SQL reserved words, compare reserved words in Oracle, PostgreSQL, MySQL, SQL Server, and SQLite, and check whether ORDER, USER, KEY, etc. can be used in table names and column names.
- Check the cause of syntax errors near identifiers in CREATE TABLE and SELECT
- Before DB migration, check whether existing table names and column names conflict with reserved words in the migration destination.
- See how new identifiers are named and cited in DDL Review
- Isolate conflicts between SQL generated by ORM and DB-specific keywords
Why are reserved words different for each DB?
- Each DB has its own syntax and keywords in addition to SQL standard reserved words
- Additional information for this feature.
- The reservation status may change depending on the DB version and SQL mode.
- Oracle, PostgreSQL, and SQLite have different quoting methods, such as double quotes, MySQL mainly backquotes, and SQL Server square brackets.
Additional information for this feature.
- Select the target database and search for the word you want to use.
- Additional information: DB
- Enter table and column names in the identifier checker to see examples of safe citations.
- If it is a new design, change the name to an easy-to-understand name that avoids reserved words.
- If you cannot change the existing assets, check the official documentation of the version you are using and the actual device to see how to quote.
Portability and future upgrade considerations
Even if the identifier can be created using quotation marks, quoting will be required every time the SQL is executed, which may cause compatibility issues with ORMs, migration tools, and other databases. It is easier to maintain if you do not newly adopt names that are the same as reserved words.
The list is the entry point for confirmation. Reserved words change depending on the version and settings, so please check the official documentation and verification environment of the DB version you will actually use when making your final decision.
Specific example: Check the column name “order” before DB migration
Since order is used in ORDER BY to indicate sorting, writing it as is as an identifier by the DB will result in a syntax error. First, check the reservation status of the source and destination side by side.
If you cannot change an existing column, use quotation marks that match the DB, but for new designs, consider using aliases such as order_number or sort_order that make it easier to understand the purpose.
- Search for order in the list and check the reservation status of the target DB.
- Sort out the handling of the migration source and migration destination by comparing between DBs.
- Check the example quotes with identifier checking and try the actual DDL and SELECT in a validation environment.
- Previous
If you want to change the identifier, search not only SQL but also ORM mapping, views, stored procedures, forms, and external linkages.
Frequently asked questions
- Can reserved words be used as identifiers if they are enclosed in quotation marks?
- Although it can be used with many databases, the type of quotation marks, handling of uppercase and lowercase letters, and SQL mode are different. For portability and maintainability reasons, it is safer to avoid reserved words in new designs.
- Are words that are not on the list always safe?
- The operation could not be completed.
Probar en el navegador
Los datos introducidos se procesan en el navegador. Conserve los datos originales y revise el resultado antes de guardarlo o compartirlo.
Open SQL reserved words/keywords list