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

SQL Insert Into Error

SQL Insert Into Error

0
Votes
1
Answer

I am following the SQL course and trying to insert gender column into my customers’ table but it keeps giving me error code 1265. Data truncated for column ‘gender’ at row 1. see below my code;
 
drop table customers;
create table customers
(
customer_id int,
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@365careers.com’,0);
 

 
1 Answer

0
Votes

add column gender enum(‘M”F’) after last_name; 
You are missing a comma
add column gender enum(‘M’,’F’) after last_name;
 

thanks Matan! that worked. had to drop and re-create table to get it working.

2 weeks
×
LAST CHANCE
Ready to Learn Data Science?
50% OFF