题解 | #0级用户高难度试卷的平均用时和平均得分#

0级用户高难度试卷的平均用时和平均得分

https://www.nowcoder.com/practice/bb474c6cbd77478fb6d9fc86934d0ebb

select ui.uid, 
    round(sum(if(score is null, 0,score))/count(*)) avg_score,
    round(sum(if (submit_time is null, duration, timestampdiff(minute, start_time, submit_time) ))/count(*),1) avg_time_took
from user_info ui left join exam_record er
on ui.uid = er.uid
join examination_info ei
on ei.exam_id = er.exam_id
where level = 0
  and difficulty = 'hard'
group by ui.uid

全部评论

相关推荐

点赞 评论 收藏
分享
每晚夜里独自颤抖:把华北改为华南再试一试,应该就没啥问题了。改完可能都不用投,别人主动联系了。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务