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

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

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

select
uid,
format(avg(score),0) avg_score,
format(avg(timestampdiff(minute,start_time,submit_time)),1) avg_time_took
from (
    select
a.uid,
c.start_time,
case when c.submit_time is null then date_add(c.start_time,interval b.duration minute)
else c.submit_time end submit_time,
case when c.score is null then 0
else score end score
from 
exam_record c
left join 
user_info a
on c.uid=a.uid
left join examination_info b
on c.exam_id=b.exam_id
where a.level=0
and b.difficulty='hard'
 ) d
 group by uid

# group by a.uid

全部评论

相关推荐

我的offer呢😡:这不才9月吗,26到明年毕业前能一直找啊,能拿下提前批,转正的,offer打牌的都是有两把刷子的,为什么非要跟他们比。如果别人是9本硕+金牌+好几段大厂实习呢?如果别人是双非通天代呢?如果别人是速通哥呢?,做好自己就行了,我们做不到他们一样提前杀死比赛,但晚点到终点也没啥关系吧
双非应该如何逆袭?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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