use chapter02;
create table Student (
Sno int not null comment '学生编号',
Sname varchar(20) not null comment '学生名称',
Sgender varchar(5) not null comment '学生性别',
SBirthday datetime comment'学生生日',
class varchar(20) comment '所属班级'
);
create table Course (
Cno int not null comment '课程编号',
Cname varchar(20) not null comment '课程名称',
Tno varchar(5) not null comment '教工编号'
);
create table Score (
Sno int not null comment '学号',
Cnno varchar(20) not null comment '课程好',
grade varchar(5) not null comment '成绩'
);
create table Teacher (
Tno int not null comment '教工编号',
Tname varchar(20) not null comment '教工名称',
Tgender varchar(5) not null comment '教工性别',
TBirthday datetime comment'教工生日',
Prof varchar(20) comment '职称'
);
alter table chapter02 rename stu_table;
desc stu_table;
alter table Teacher change `teacher` Tgender varchar;
alter table Teacher add column depart varchar(10);
alter table Teacher modify Prof varchar(10) first 或 after Tname;
alter table Teacher drop column Tgender;
drop table Teacher;
show variables like "%char%";