0

What is the purpose of this symbol in MySQL queries?

`

For example:

SELECT `show` FROM table WHERE id = "4"
Mark Byers
  • 811,555
  • 193
  • 1,581
  • 1,452
lolalola
  • 3,773
  • 20
  • 60
  • 96

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
  • 811,555
  • 193
  • 1,581
  • 1,452
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,280
  • 2
  • 15
  • 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,593
  • 1
  • 27
  • 32