写SQL,学生表student(studentid,name)
绩表score(scoreid,studentid,score)
求出平均成绩大于60 且 至少有两门成绩高于70分的学生的编号和姓名
/* 学生表student(studentid,name) 绩表score(scoreid,studentid,score) 求出平均成绩大于60 且 至少有两门成绩高于70分的学生的编号和姓名 */ select studentid, name from student where studentid in ( select studentid from score where studentid in (select studentid from score where score>65 group by studentid having count(studentid)>=2 ) group by studentid having avg(score)>60 )