一个数据库存储过程小问题

这个数据库建立没有什么难度,但是我就是陷入了一种错误的思维,一直跳不出来,刚刚灵光一现,跳出循环,终于跳出错误的模式,构建好了一个数据库存储过程。


--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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值