Can we have the table name as "option" in MySQL?

I am very, very new to MYSQL.I tried to create a table named "option". My SQL Query is :

create table option(

id int not null primary key auto_increment,

choice varchar(30)

)

While executing this query it shows the following error

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 'option( id int not null primary key auto_increment, choice varchar(30) )' at line 1 (0 ms taken)

If I try with the table name as "choice" it is working.

can we have the table name as "option" in mysql?

thanks

Answers


Pick a different name (one that isn't a reserved word in your RDBMS) and save yourself and whoever else might work on it many headaches.


If you want to have a table name Option, you should be able to, just remember that whenever you use the table in a query, you will have to encase it in ` symbols. Like this.

`option`

The ` key on the top left of your keyboard, with the tilde.


Need Your Help

How to get data from remote database using TSQL?

sql database

Is it possible to get data from remote server using JUST TSQL? I mean to do it just with script and without any actions (setting up linked servers and etc) on local server. Need to query something ...