Usage of backtick in SQL statements?


The backtick can be used in MySQL. To create a table, we can put table_name in backticks.

Example of Backtick in MySQL.

The CREATE command is used to create a table. Here, we have added the table name using the backtick symbol.

mysql> create table `backtickSymbol`
   -> (
   -> uniId int
   -> );
Query OK, 0 rows affected (1.65 sec)

Records are inserted with the help of INSERT command.

mysql> insert into `backtickSymbol` values(1);
Query OK, 1 row affected (0.20 sec)

mysql> insert into `backtickSymbol` values(2);
Query OK, 1 row affected (0.17 sec)

mysql> insert into `backtickSymbol` values(3);
Query OK, 1 row affected (0.09 sec)

mysql>  insert into `backtickSymbol` values(4);
Query OK, 1 row affected (0.16 sec)

To display all records.

mysql> select *from `backtickSymbol`;

The following is the output that displays all the records.

+-------+
| uniId |
+-------+
|     1 |
|     2 |
|     3 |
|     4 |
+-------+

Updated on: 30-Jul-2019

371 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements