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
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.
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.
You can use SQL keywords as table names in MySQL if you escape them with back-quotes.
CREATE TABLE `option` (
...
)
It's not normally a good idea to do so, though.
option is a reserved word in Mysql.we can use a reserved word by using the word inside a single quotes.
Yes you can definitely create a table named option but in every query you will have to use
`option`
instead of plain option
. Better improvise a little and create a table named options to save from trouble. Restrain from using mysql reserved words as table name or column name or procedure names.
See the MySQL documentation on this. You can do it as follows:
create table `option` (
...
)