create table syntax error
I want to create a table in DOS command line prompt.
I received a syntax error message but I couln't find out what caused the error.
Could somone take look at my 'create table' syntax and tell me what I did wrong?
I appreciate your help!
---------- Error Message --------------------------
create table computers(
emp_id int unsigned not null auto_increment,
pc_name varchar(50) not null,
current_user varchar(50) not null,
make varchar(50) not null,
model varchar(50) not null,
OS varchar(50) not null,
purchase_date datetime not null,
in_use varchar(1) not null,
location varchar(50) not null,
product_num varchar(50) not null,
os_key varchar(50) not null,
primary key (emp_id));
ERROR 1064 (42000): 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 'current_user varchar(50) not null,
ms_office_key varchar(' at line 4
"current_user" is a MySQL reserved word, so you'll need to quote it (with `back ticks`) if you want to use it as a column name. (Thus it can be a useful habit to always quote table and column names.)
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Thanks for pointing out my problem. I modified the reserved keyword and I was able to crate the table.
Originally Posted by NogDog
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)