SQL Insert Into Error
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);
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 answers ( 0 marked as helpful)
add column gender enum(‘M”F’) after last_name;
You are missing a comma
add column gender enum(‘M','F’) after last_name;