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

