0

What is the purpose of this symbol in MySQL queries?

`

For example:

SELECT `show` FROM table WHERE id = "4"
Mark Byers
  • 767,688
  • 176
  • 1,542
  • 1,434
lolalola
  • 3,689
  • 19
  • 57
  • 92

3 Answers3

4

In MySQL the backtick is used to quote column names. It is normally optional but here it is needed because SHOW is a reserved word.

A list of reserved words can be found here.

Mark Byers
  • 767,688
  • 176
  • 1,542
  • 1,434
2

There is a difference between quotation marks (' and ") and backticks (`) in mysql.

Backticks are known as an "identifier quote" and are used to surround identifiers, such as:

tables columns indexes stored functions etc.

Quote go around strings, often used when inserting, updating, or trying to match against a string in the database (eg a WHERE clause)

Jon
  • 3,080
  • 2
  • 14
  • 16
0

Backticks are known as an "identifier quote" and are used to surround identifiers, such as: you can live without them but but they are necessary when

  • identifiers name contains spaces e.g. a column name is `customer name `
  • identifiers name is a reserved work e.g. a column name is `name `
Gajendra Bang
  • 3,573
  • 1
  • 24
  • 32