34,837
社区成员




select(select sname from student where student.sno=sc.sno)as sname,
(select cname from course where cno=sc.cno)as cname
from sc,(select cno as cno,avg(grade) as grade from sc group by cno)as c
Where sc.cno=c.cno and sc.grade> c.grade
--课程表在这个查询中没有用.
select a.sname from student a , course b,
(select cno , avg(grade) grade_avg from course group by cno) t
where a.sno = bsno and b.cno = t.cno and b.grade > t.grade_avg
--课程表在这个查询中没有用.
select a.student.sname from student a , course b,
(select cno , avg(grade) grade_avg from course group by cno) t
where a.sno = bsno and b.cno = t.cno and b.grade > t.grade_avg
select cs.cno,student.sname,cs.garde from sc left join student on (student.sno=sc.sno)
left join
(select cno,avg(grade) as avgGarde from sc) sc1 on (sc.cno=sc1.cno and sc.grade>sc1.avggarde)