题解 | #试卷发布当天作答人数和平均分#
试卷发布当天作答人数和平均分
https://www.nowcoder.com/practice/5b58e89556dc4153a79d8cf8c08ba499
select b.exam_id, count(distinct b.uid) uv, format(sum(b.score) /count( b.uid),1) avg_score from examination_info a, exam_record b, user_info c where a.exam_id=b.exam_id and a.tag='SQL' and b.submit_time is not null and date_format(b.submit_time,'%y%m%d')=date_format(a.release_time,'%y%m%d') and b.uid=c.uid and c.level>5 group by b.exam_id order by uv desc,avg_score asc