1

I have this SQL Query

   CREATE TABLE items(
   partnum VARCHAR( 20 ) NOT NULL ,
   DESC VARCHAR( 50 ) NOT NULL ,
   price INT( 11 ) NOT NULL ,
   src VARCHAR( 25 ) NOT NULL ,
   PRIMARY KEY (  `partnum` )
   );

It's meant to create a table in my database but I keep receiving the following error:

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 'desc varchar(50) NOT NULL,
 price int(11) NOT NULL,
 src varchar(25) NOT NULL,
 ' at line 3 

Any idea what i'm doing wrong?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user182
  • 1,805
  • 5
  • 18
  • 18

1 Answers1

0

Desc is a reserved keyword it cant used as a name of column, put it in quotes

or rename it to e.g Description

apomene
  • 14,282
  • 9
  • 46
  • 72