• 主页
• 基础类
• 应用实例
• 新技术前沿

# 查询选修的课程的成绩大于该课程的平均成绩的所有学生姓名。

wxxloveu 2007-12-15 10:00:27

(1) “学生”表Student由学号（Sno）、姓名（Sname）、性别（Ssex）、年龄（Sage）、所在系（Sdept）五个属性组成，可记为： Student(Sno,Sname,Ssex,Sage,Sdept) Sno 为关键字。
(2) “课程”表Course由课程号（Cno）、课程名（Cname）、任课教师(Cteacher)、学分（Ccredit）四个属性组成，可记为： Course(Cno,Cname, Cteacher,Ccredit) Cno为关键字。

...全文
794 点赞 收藏 7

7 条回复

FROM COURSE,SC GROUP BY COURSE.CNO) AS T,
FROM SC
GROUP BY CNO) AS X

wxxloveu 2007-12-18
``````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

zjexe 2007-12-15

dawugui 2007-12-15
``````--课程表在这个查询中没有用.

select a.sname from student a , course b,
where a.sno = bsno and b.cno = t.cno and b.grade > t.grade_avg``````

dawugui 2007-12-15
``````--课程表在这个查询中没有用.
select a.student.sname from student a , course b,
where a.sno = bsno and b.cno = t.cno and b.grade > t.grade_avg``````

lizhongheng 2007-12-15
``````select cs.cno,student.sname,cs.garde from sc left join student on (student.sno=sc.sno)
left join

lucky749 2007-12-15
select (select SName from Student where Student.SNo=Sc.SNo) as SNo,(select CName from Course where Cno=Sc.CNo) as Cno1 from Sc,(select CNo as CNo1,avg(Grade1) as Grade from Sc group by CNo) as c

MS-SQL Server

3.2w+

MS-SQL Server相关内容讨论专区