答案是不是下面的呢,大家帮我核对下,1.查找小伟同学的课程总分
select sum(score) score
from student t,score s
where t.sid = s.sid
and t.name = '小伟'
;2.假设没有人缺考,请输出平均分不小于85分的人员总数select count(sid)
from (
select s.sid,avg(score) score
from score s
group by s.sid
having avg(score)>=85
)3.缺考学生的成绩,请插入学生成绩数据,其中成绩设置为0
insert into score(sid,cid,score)
select t.sid,c.cid,0
from student t,course c
where not exists(select s.sid from score s where s.sid = t.sid and s.cid = c.cid)
select sum(score) score
from student t,score s
where t.sid = s.sid
and t.name = '小伟'
;2.假设没有人缺考,请输出平均分不小于85分的人员总数select count(sid)
from (
select s.sid,avg(score) score
from score s
group by s.sid
having avg(score)>=85
)3.缺考学生的成绩,请插入学生成绩数据,其中成绩设置为0
insert into score(sid,cid,score)
select t.sid,c.cid,0
from student t,course c
where not exists(select s.sid from score s where s.sid = t.sid and s.cid = c.cid)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货