The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

DEFAULT constraint

DEFAULT constraint

0
Votes
1
Answer

Hello 365 
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
 

1 Answer

365 Team
0
Votes

Hi Ashakah!
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,
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;

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.
Best,
Martin