写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 
)

相关文章:

  • 2021-09-10
  • 2021-11-03
  • 2021-12-20
猜你喜欢
  • 2021-06-13
  • 2021-08-11
  • 2022-12-23
  • 2021-07-02
  • 2021-09-17
  • 2021-11-13
  • 2021-09-09
相关资源
相似解决方案