题解 | #对试卷得分做min-max归一化#

对试卷得分做min-max归一化

https://www.nowcoder.com/practice/2b7acdc7d1b9435bac377c1dcb3085d6

select uid,exam_id,round(sum(normal_score)/count(normal_score),0) 'avg'
from(select uid,exam_id,if(min_score=max_score,score,(score-min_score)*100/(max_score-min_score)) 'normal_score'
from (select uid,exam_id,submit_time,score,min(score)over(partition by exam_id) 'min_score',max(score)over(partition by exam_id) 'max_score'
from exam_record
where exam_id in 
(
    select exam_id
    from examination_info
    where difficulty = 'hard'
) and submit_time is not null
) t1)t2
group by uid,exam_id
order by exam_id asc,avg desc

全部评论

相关推荐

05-09 12:23
已编辑
华南理工大学 Java
野猪不是猪🐗:给他装的,双九+有实习的能看的上这种厂我直接吃⑨✌们拿它练练面试愣是给他整出幻觉了
点赞 评论 收藏
分享
迷茫的大四🐶:自信一点,我认为你可以拿到50k,低于50k完全配不上你的能力,兄弟,不要被他们骗了,你可以的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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