这个数据库建立没有什么难度,但是我就是陷入了一种错误的思维,一直跳不出来,刚刚灵光一现,跳出循环,终于跳出错误的模式,构建好了一个数据库存储过程。
--1、创建一个存储过程no_grade,显示有所选课程没有成绩的学生的学号、姓名、
-- 所选全部课程名称及其成绩。
use Stu_Cou
go
create procedure no_grade
as
select Student.Sno,Course.Cno,Sname,Cname,Grade
from Student,SC,Course
--where Grade is null and Student.Sno=SC.Sno and Course.Cno=SC.Cno
where Student.Sno in
(select Sno
from SC
where Grade is null
)
and Course.Cno in
(select Cno
from SC
where SC.Sno=Student.Sno
)
and Student.Sno=SC.Sno and Course.Cno=SC.Cno