题解 | #试卷发布当天作答人数和平均分#

试卷发布当天作答人数和平均分

https://www.nowcoder.com/practice/5b58e89556dc4153a79d8cf8c08ba499

select 
a.exam_id,
count(distinct a.uid) uv,
round(sum(a.score)/count(1),1) avg_score

from exam_record a 
left join  examination_info b 
on (a.exam_id=b.exam_id and date(a.submit_time)=date(b.release_time))
left join user_info c on a.uid=c.uid 
where a.score is not null and c.level>5 and b.tag='SQL'
group by a.exam_id
order by uv desc ,avg_score;

全部评论

相关推荐

吴offer选手:幽默小厂
点赞 评论 收藏
分享
04-17 18:32
门头沟学院 Java
野猪不是猪🐗:他跟你一个学校,你要是进来之后待遇比他好,他受得了?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务