1. 查询选修了课程的学生人数
2. 计算1号课程的学生平均成绩
3. 查询选修1号课程的学生最高分数
4. 查询学生200215012选修课程的总学分数连接查询:
5. 查询每 个学生及其选修课程的情况
6. 查询每一门课的间接先修课(即先修课的先修课)
7. 查询选修2号课程且成绩在90分以上的所有学生的学号,姓名
GROUP BY 子句
32. 求各个课程号及相应的选课人数
33.查询选修了3门以上课程的学生学号
嵌套查询:
34.查询与“刘晨”在同一个系学习的学生
35.查询选修了课程名为“信息系统”的学生的学号和姓名
36.查询其他系中比计算机科学系某一学生年龄小的学生姓名和年龄
37.查询其他系中经计算机科学系所有学生年龄都小的学生姓名及年龄
带有EXISTS谓词的子查询:
38.查询所有选修了1号课程的学生姓名
39.查询没有选修1号课程的学生姓名
1\select count(*) from Student
2\select count(*) from SC group by Sno
3\select avg(s.Grade) from Student t,SC s where t.Sdept = 'CS' and t.Sno = s.Sno
4\select max(Grade) from SC where Cno = '1'
5\select Sum(c.Ccredit) from SC s,Course c where s.Sno = '200215012'
and s.Cno = c.Con
6\select s.Sno,s.Sname,s.Ssex,s.Sage,s.Sdept,c.Cno,C.Cname,C.Cpno,c.Ccredit form SC sc,Course c,Student s where s.Sno = sc.Sno and c.Cno = sc.Cno
7,
select cname form course where spon in(select cname from selectcourse cpon=cno)
8\select t.Sno,t.Sname from Student t,SC s where s.Cno = '2' and s.Grade > 90 and s.Sno = t.Sno
32\select Cno,count(0) from SC group by Cno
33\select Sno from SC cc where (select count(0) from SC c where c.Sno = cc.Sno group by Sno ) > 3
34\select * from Student t where t.Sdept = (select tt.Sdept from Student tt where tt.Sname = '刘晨')