题解 | #试卷发布当天作答人数和平均分#
试卷发布当天作答人数和平均分
https://www.nowcoder.com/practice/5b58e89556dc4153a79d8cf8c08ba499
select
exam_id,
count(distinct uid) uv,
round(avg(score), 1) avg_score
from
exam_record er
left join user_info ui using (uid)
left join examination_info ei using (exam_id)
where
tag = 'SQL'
and date_format (start_time, '%Y%m%d') = date_format (release_time, '%Y%m%d')
and level > 5
group by
exam_id
order by
uv desc,
avg_score asc;
查看9道真题和解析