题目:查询两门及其以上不及格课程的同学的学号,姓名及其平均成绩

 

分析:这个我想了半天,我的局限思维是一直在学生分数表 student_score 表中直接 分组 group by ,再去筛选分数

    可以先筛选分数再 分组 并having count 

 

sql 于下:

 

select student.id, student.stdentname, AVG(student_score.score) from student,student_score
where
     student.id = student_score.studentid and student_score.score<60
group by student_score.studentid
having count(*)>1;

 

 

【sql:练习题11】查询两门及其以上不及格课程的同学的学号,姓名及其平均成绩

 

相关文章:

  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案