In every MySQL version, there are new reserved keywords. The keywords, such as CREATE, SELECT, UPDATE and DROP, are mainly SQL commands or functions.
MySQL developers usually do not use these keywords as database, table or column names. The complete list of keywords and a way to use them can be found in this help article.
List of Keywords
A complete list of all reserved words in MySQL 5.7 can be found here.
Using Keywords in Tables or Columns
Generally, SQL developers advise against using reserved words. However, if you want (or need) to use a reserved word as a table or column name, you can place the respective identifier in special quotation marks, so-called backticks (` `), in the SQL statements.
Here is an example: You want to use the reserved word UPDATE in an SQL statement.
- This is the wrong way to use it:
- SELECT update FROM table
- The interpreter understands the word update as SQL command UPDATE, although it was written in lower case. The result will be a syntax error message.
- If you write the word update in quotation marks instead, it will be executed correctly.
- Here is a correct way to use it:
- SELECT `update` FROM table;