Sic3227017
CREATE TABLE tblStudent(
StuId int,
StuName VARCHAR(14),
StuAge int,
StuSex VARCHAR(1),
PRIMARY KEY(StuId)
);
CREATE TABLE tblTeacher(
TeaId int,
TeaName VARCHAR(14),
PRIMARY KEY(CourseId)
);
CREATE TABLE tblCourse(
CourseId int,
CourseName VARCHAR(14),
TeaId int,
PRIMARY KEY(CourseId)
key TeaId (TeaId),
foreign key (TeaId) references tblTeacher(TeaId)
);
CREATE TABLE tblScore(
StuId int,
CourseId int,
Score float,
PRIMARY KEY(CourseId),
key StuId (StuId),
foreign key (StuId) references tblStudent(StuId)
key CourseId (CourseId),
foreign key (CourseId) references tblCourse(CourseId)
);