查询两门及其以上不及格课程的同学的学号,姓名及其平均成绩
从SC表中选取score小于60的,并group by sid,having count 大于1
select student.sid, student.sname, AVG(sc.score) from student,sc
where
student.sid = sc.sid and sc.score<60
group by sc.sid
having count(*)>1;
查询两门及其以上不及格课程的同学的学号,姓名及其平均成绩
从SC表中选取score小于60的,并group by sid,having count 大于1
select student.sid, student.sname, AVG(sc.score) from student,sc
where
student.sid = sc.sid and sc.score<60
group by sc.sid
having count(*)>1;