2 Replies - 263 Views - Last Post: 15 January 2014 - 05:03 PM Rate Topic: -----

#1 stdq  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 64
  • Joined: 15-May 12

Problem creating a simple database

Posted 15 January 2014 - 04:37 PM

Hi, everyone! I'm relatively new to SQL, and I am trying to create a table with the following command:

CREATE TABLE jobs (
id BIGINT NOT NULL AUTO_INCREMENT,
company VARCHAR(200) NOT NULL,
desc VARCHAR(200) NOT NULL,
PRIMARY KEY(id)
);

However, MySQL tells me there is an error in the command syntax. What am I doing wrong? Thanks in advance!
Is This A Good Question/Topic? 0
  • +

Replies To: Problem creating a simple database

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 2885
  • View blog
  • Posts: 9,573
  • Joined: 12-December 12

Re: Problem creating a simple database

Posted 15 January 2014 - 05:01 PM

DESC is an sql keyword, used to sort in descending order; you cannot use it as a field-name.

(You can if you surround it in back-tick delimiters, but DON'T DO THIS. Rename the field.)
Was This Post Helpful? 0
  • +
  • -

#3 stdq  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 64
  • Joined: 15-May 12

Re: Problem creating a simple database

Posted 15 January 2014 - 05:03 PM

It worked, thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1