立即学习:https://edu.csdn.net/course/play/27328/362521?utm_source=blogtoedu
sex char(1)‘男’‘女’
alter table contacts add sex char(1)
alter table contacts modify sex int;
alter table contacts drop column sex;
create table contacts(
id int not null auto_increment primary key,
name varchar(50),
sex tinyint default 1,
phone varchar(20)
);
insert into contacts(name, sex, phone) values ('张三', 1 , '13956452855');
insert into contacts(name, sex, phone) values ('Tom\'s cat', 1 , '13956456655');
insert into contacts(name, sex, phone) values ("Lily's cat", 1 , '13956456656');
insert into contacts(name, sex, phone) values ('李四', 1 , '1390000001'),('王五', 1 ,'1390000002');
update contacts set sex=2;
update contacts set sex=1;
update contacts set sex=2 where id =3 ;
update contacts set sex=2, phone='18900001111' where id =5;
delete from contacts where id = 4;
delete from contacts;
insert into person(name,id_number) value('张三','654312199012301065');
insert into person(name,id_number) value('张2','654312199012301065');
insert into stu(stu_no,stu_name) values('201901','张三'),('201902','李四');
insert into sc(stu_no, course,grade) values('201901','计算机',100),('201902','计算机',59);