分别创建三个表:学生表、课程表、成绩表
学生表
create table students(
id int auto_increment primary key not null,
name varchar(10) not null,
gender bit default(1),
birthday datetime,
isDelete bit default(0)
);
科目表
create table subjects(
id int auto_increment primary key not null,
sname varchar(20) not null
);
成绩表
create table scores(
id int primary key auto_increment,
stuid int,
subid int,
score decimal(5,2),
foreign key(stuid) references students(id),
foreign key(subid) references subjects(id)