Last answered:

22 May 2024

Posted on:

13 Mar 2023

3

error code 1064

0
4
23:07:25
( customer_ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, first_name varchar(255), last name varchar(255), email address varchar(255), number of complaints int, )
Error Code: 1064. 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 'customer_ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, first_name varchar(255), la' at line 2
0.016 sec

iam getting the error while iam entering customer id unable to figure out

please help me out

1 answers ( 0 marked as helpful)
Instructor
Posted on:

22 May 2024

0

Hi Swetha!

Thanks for reaching out!


The error message is due to the space between "last" and "name" and "email" and "address"  in your SQL statement. The correct syntax should be:

CREATE TABLE customers (
customer_ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, 
first_name varchar(255), 
last_name varchar(255), 
email_address varchar(255), 
number_of_complaints INT
);

Ensure there are no spaces in column names and try again.
 

Hope this helps.
Best,
Martin

Submit an answer