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,
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?
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.
The ` key on the top left of your keyboard, with the tilde.