题解 | #试卷发布当天作答人数和平均分#
试卷发布当天作答人数和平均分
https://www.nowcoder.com/practice/5b58e89556dc4153a79d8cf8c08ba499
select
t3.exam_id,
count(distinct t3.uid) as uv,
round(avg(t3.score),1) as avg_score
from exam_record as t3
left join user_info as t1
on t1.uid = t3.uid
left join examination_info as t2
on t2.exam_id = t3.exam_id
where
t2.tag = 'SQL'
and
t1.level > 5
and
date(t3.start_time) = date(t3.submit_time)
group by exam_id
order by uv desc, avg_score
