MySQL has some special names called reserved words. A reserved word can be used as an identifier for a table, column, etc. only if it's wrapped in backticks (`), otherwise it will give rise to an error.
To avoid such errors, either don't use reserved words as identifiers or wrap the offending identifier in backticks.
Listed below are all reserved words (from the official documentation):
When trying to select from a table called
order like this
select * from order
the error rises:
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order' at line 1
Reserved keywords in MySQL need to be escaped with backticks (
select * from `order`
to distinguish between a keyword and a table or column name.