9.查询“001”课程比“002”课程成绩高的所有学生的学号;
select a.s_id from (select s_id,score from SC where C_ID=‘001’) a,(select s_id,scorefrom SC where C_ID=‘002’) b where a.score>b.score and a.s_id=b.s_id;
10.查询平均成绩大于60分的同学的学号和平均成绩;
select S_ID,avg(score) from sc group by S_ID having avg(score) >60;
11.查询所有同学的学号、姓名、选课数、总成绩;
select Student.S_ID,Student.Sname,count(SC.C_ID),sum(score) from Student left Outer join SC on Student.S_ID=SC.S_ID group by Student.S_ID,Sname