0
CREATE TABLE IF NOT EXISTS references(
id INTEGER NOT NULL AUTO_INCREMENT,
title VARCHAR(25),
name VARCHAR(25),
profession VARCHAR(25),
address VARCHAR(25),
city VARCHAR(25),
state VARCHAR(25),
country VARCHAR(25),
mobileNumber VARCHAR(25),
emailAddress VARCHAR(25),
referenceType VARCHAR(25),
applicant_id INTEGER,
PRIMARY KEY(id)
);

The error:

SQL State  : 42000
Error Code : 1064
Message    : 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 'references(
id INTEGER NOT NULL AUTO_INCREMENT,
title VARCHAR(25),
name VA' at line 1  

I have no idea what the error means by name VA' and the query has name VARCHAR(25)

vhu
  • 12,244
  • 11
  • 38
  • 48
  • `references` is a reserved word either choose a different name for the table or backtick the name in the statement. https://dev.mysql.com/doc/refman/5.5/en/keywords.html – Abhik Chakraborty Jul 24 '15 at 10:13

1 Answers1

0

You can use like these. Here references is the keyword of mysql.

CREATE TABLE IF NOT EXISTS `references`(
    id INTEGER NOT NULL AUTO_INCREMENT,
    title VARCHAR(25),
    name VARCHAR(25),
    profession VARCHAR(25),
    address VARCHAR(25),
    city VARCHAR(25),
    state VARCHAR(25),
    country VARCHAR(25),
    mobileNumber VARCHAR(25),
    emailAddress VARCHAR(25),
    referenceType VARCHAR(25),
    applicant_id INTEGER,
    PRIMARY KEY(id)
    );

Thank you.

Venkatesh Panabaka
  • 2,064
  • 4
  • 19
  • 27