MySQL reserved keywords

In MySQL, there are several reserved keywords that have special meanings in SQL and cannot be used as identifiers such as table names, column names, or aliases without quoting. Here are some of the reserved keywords in MySQL:

  1. ADD
  2. ALL
  3. ALTER
  4. ANALYZE
  5. AND
  6. AS
  7. ASC
  8. AUTO_INCREMENT
  9. BETWEEN
  10. BINARY
  11. BOTH
  12. BY
  13. CASE
  14. CASCADE
  15. CHAR
  16. CHECK
  17. COLLATE
  18. COLUMN
  19. CONSTRAINT
  20. CREATE
  21. CURRENT_DATE
  22. CURRENT_TIME
  23. CURRENT_TIMESTAMP
  24. DATABASE
  25. DEFAULT
  26. DELETE
  27. DESC
  28. DISTINCT
  29. DROP
  30. ELSE
  31. ENCLOSED
  32. ENUM
  33. ESCAPED
  34. EXISTS
  35. EXPLAIN
  36. FALSE
  37. FETCH
  38. FLOAT
  39. FOR
  40. FOREIGN
  41. FROM
  42. FULLTEXT
  43. GROUP
  44. HAVING
  45. IF
  46. IGNORE
  47. IN
  48. INDEX
  49. INNER
  50. INSERT
  51. INTO
  52. IS
  53. JOIN
  54. KEY
  55. LEFT
  56. LIKE
  57. LIMIT
  58. LOCK
  59. MATCH
  60. NATURAL
  61. NOT
  62. NULL
  63. ON
  64. OR
  65. ORDER
  66. OUTER
  67. PRIMARY
  68. REFERENCES
  69. RIGHT
  70. SELECT
  71. SET
  72. SHOW
  73. TABLE
  74. THEN
  75. TO
  76. TRUNCATE
  77. TRUE
  78. UNION
  79. UNIQUE
  80. UPDATE
  81. VALUES
  82. VARCHAR
  83. WHEN
  84. WHERE
  85. WITH

It’s important to note that although these words are reserved, you can still use them as identifiers if you quote them using backticks (`). However, it’s generally a good practice to avoid using reserved keywords as identifiers to prevent potential confusion and errors.