题解 | #作答试卷得分大于过80的人的用户等级分布#
作答试卷得分大于过80的人的用户等级分布
https://www.nowcoder.com/practice/5bc77e3a3c374ad6a92798f0ead4c744
# 统计作答 SQL 类别的试卷的分大于过 80 的用户等级分布,数量降序排序 # 思路: # 1. 先筛选出 SQL 类别的试卷 # 2. 查询作答记录表,筛选出用户 # 3. 查询用户表获取用户等级 select level, count(distinct ui.uid) as level_cnt from exam_record er inner join user_info ui on er.uid = ui.uid where er.exam_id in( select exam_id from examination_info where tag = 'SQL') and submit_time is not null and score > 80 group by level order by level_cnt desc, level desc