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