sql至少选了三门课程并且平均成绩及格的学生的学号以及平均成绩和选课数量
假设stu表有sno,sname字段;sc表有sno,cno,score字段
select t.sno,avg(t1.score) avg_score,count(*) from stu t join sc t1 on t.sno=t1.sno group by t.sno having count(*)>=3 and avg(t1.score)>=60
group by having 搜搜