-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
朋友你好,11题我理解的是,找到有两门及以上不及格课程的同学的学号。之后求其平均成绩。所以我的sql如下,你认为哪个理解符合题意一点呢?
select s.SId, s.Sname, avg(sc2.score)
from Student s
inner join (
select sc.SId from SC sc where sc.score < 60 group by sc.SId having count(1) >= 2
) as failed_two on s.SId = failed_two.SId
inner join SC sc2 on s.SId = sc2.SId
group by 1, 2;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels