create table stu (studentID varchar(10),Name varchar(20),Age int,Sex varchar(5),Grade varchar(10)) create table score(studentID varchar(10),Grade varchar(10),Chinese float, math float,english float)declare @stuID varchar(10) select b.* from stu a ,score b where b.studentID = a.studentID and a.Grade = b.Grade and a.studentID = @stuID
create table score(studentID varchar(10),Grade varchar(10),Chinese float, math float,english float)declare @stuID varchar(10)
select b.* from stu a ,score b where b.studentID = a.studentID and a.Grade = b.Grade
and a.studentID = @stuID
我觉得是这样的,大家看看,行不行,给点意见哦,表student(学生):学号(stuID),姓名(Name),年龄(Age),性别(Sex)
表course(课程):学号(studentID),课程号(curID),课程名(curName)
表score(分数):课程号(curID),分数(score)
表stuGrade(学生年级表):学号(stuID),年级(Grade),开始时间(startTime),结束时间(endTime)我对表stuGrade的设计,觉得有点疑问,大家帮一下看看
1.觉得 把表stuGrade 并在 表student 中也应该行啦.像下面设计:表student(学生):学号(stuID),姓名(Name),年龄(Age),性别(Sex),年级(Grade),入学年份(year)要考虑升级,知道入学年份与当时的年级,那就可以算出现在是几年级,可如果留级,这样也算不出哦.
所以觉得还是要分开.大家看看这样行不行,给个意见,谢谢!!
表student(学生):学号(stuID),姓名(Name),年龄(Age),性别(Sex),入学年份(startTime),毕业时间(endTime)
表course(课程):课程号(curID),课程名(curName)
表score(分数):学号(studID),考试年份(testTime),课程号(curID),分数(score)
表stuGrade(学生年级表):学号(stuID),年级(Grade),考试年份(testTime)