题解 | #作答试卷得分大于过80的人的用户等级分布#
作答试卷得分大于过80的人的用户等级分布
https://www.nowcoder.com/practice/5bc77e3a3c374ad6a92798f0ead4c744
with t as (
select uid, a.exam_id, b.tag, score
from exam_record as a
left join examination_info as b
on a.exam_id = b.exam_id
)
select level, count(uid) as level_cnt
from (
select c.uid, d.level
from (
select uid
from t
where tag = 'SQL' and score > 80
) as c
left join user_info as d
on c.uid = d.uid
) as e
group by level
order by level_cnt desc;

