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

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

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


select t.exam_id,count(distinct e1.uid) as uv 
,round(avg(e1.score),1) as avg_score
from exam_record e1 
join 
(
    select exam_id,release_time
    from examination_info
    where tag="SQL"
) t
on t.exam_id = e1.exam_id
join user_info e2 
on e1.uid=e2.uid
where e2.level>5
and date_format(t.release_time,"%Y%m%d")=date_format(e1.start_time,"%Y%m%d")
group by t.exam_id
order by uv desc,avg_score 

全部评论

相关推荐

04-17 18:32
门头沟学院 Java
野猪不是猪🐗:他跟你一个学校,你要是进来之后待遇比他好,他受得了?
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
03-28 13:48
hory权:校招vip纯神人了,还说自己是什么师范大学的
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务