Error in SQL Syntax ERROR1064

Posted by 01010011 on Stack Overflow See other posts from Stack Overflow or by 01010011
Published on 2010-04-16T02:33:15Z Indexed on 2010/04/16 2:43 UTC
Read the original article Hit count: 296

Filed under:

Hi,

Everytime I try to create the following table in MySQL command line:

CREATE TABLE book(book_id int NOT NULL AUTO_INCREMENT PRIMARY KEY, 

isbn char(20),

title char(20),

author_f_name char(20),

author_l_name char(20),

condition ENUM("as new","very good","good","fair","poor"),

price decimal(8,2),

genre char(20));

I keep getting this error message:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL version for the right syntax to use near 'condition ENUM("as new","very good","good","fair","poor"), price decimal(8,2), g' at line 6

I've tried using single quotes and double quotes for the ENUM options. Where did I go wrong?

© Stack Overflow or respective owner

Related posts about mysql