Last answered:

29 Feb 2024

Posted on:

28 Feb 2024

0

Getting Error Code 1064 -

Hello, 

Hopefully you guys can help me here is the code i put in and first two sections of the code ran well its last section on the "insert into" line that i keep getting an x mark and cant seem to know why it keeps happening.


CREATE TABLE customers
(
 customer_id INT auto_increment,
    first_name varchar(255),
    last_name  varchar(255),
    email_address varchar(255),
    number_of_complaints INT,
PRIMARY KEY (customer_id)
);


ALTER TABLE customers
ADD COLUMN gender enum('M','F') AFTER last_name;


insert into customers (first_name, last_name, gender, email_address, number_of_complaints),
VALUES ('John', 'Mackinley', 'M', 'john.mckinley@365datascience.com', 0);

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

29 Feb 2024

0

Hi Carlos!

Thanks for reaching out!

The error you're encountering is probably due to an extra comma you put after the column names list. This should not be there.

insert into customers (first_name, last_name, gender, email_address, number_of_complaints),
VALUES ('John', 'Mackinley', 'M', 'john.mckinley@365datascience.com', 0); 


Here is the corrected version:

INSERT INTO customers (first_name, last_name, gender, email_address, number_of_complaints)
VALUES ('John', 'Mackinley', 'M', 'john.mckinley@365datascience.com', 0);

Hope this helps.

Best,

Ivan

Submit an answer