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

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

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

全部评论

相关推荐

喜欢飞来飞去的雪碧在刷代码:可以试一试字节
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务