Last answered:

06 Mar 2023

Posted on:

05 Mar 2023

0

Error code: 1064

This is the syntax I write and always results in an error

(
purchase_number INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
date_of_purchase DATE NOT NULL,
customer_id INT,
item_code VARCHAR(10) NOT NULL
);

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

06 Mar 2023

1

Hi Mohamed!
Thanks for reaching out.


You have missed the CREATE TABLE statement. The correct query is:

CREATE TABLE sales

(
purchase_number INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
date_of_purchase DATE NOT NULL,
customer_id INT,
item_code VARCHAR(10) NOT NULL
);


Hope this helps.
Best,
Tsvetelin

Submit an answer