Please I gave the query statement but its giving me the error message Error Code: 1054 Unknown column ‘last_name’ in ‘field list’
INSERT INTO customers (first_name, last_name, gender)
VALUES (‘Peter’, ‘Figaro’, ‘M’)
Please what did I do wrong
Thanks for reaching out.
Please make sure you don’t skip any lecture or exercise while taking this course. We gradually modify the contents of our data tables and it is essential that you don’t skip any steps.
That said, it seems that currently you don’t have a field called last_name in your customers table. Please make sure you’ve completed the exercise of the UNIQUE Constraint lecture – https://365datascience.teachable.com/courses/360102/lectures/5518488 (which is the lecture preceding the one you are referring to).
In other words, please make sure to have created and altered the customers table by executing the following code:
CREATE TABLE customers (
customer_id INT AUTO_INCREMENT,
PRIMARY KEY (customer_id)
ALTER TABLE customers
ADD COLUMN gender ENUM('M', 'F') AFTER last_name;
After you can confirm that you have done that, please retry executing the code you’ve posted in your question.
Hope this helps but please feel free to get back to us should you need further assistance. Thank you.