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

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

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

select uid,exam_id
,ifnull(round(avg(100*(score-min_score)/(max_score-min_score)),0),0) as avg_new_score
from 
(
    select *
    ,max(score) over(partition by exam_id) as max_score
    ,min(score) over(partition by exam_id) as min_score
    from exam_record
    where exam_id in 
    (
    select exam_id
    from examination_info
    where difficulty="hard"
    )
) t
group by exam_id,uid
order by exam_id,avg_new_score desc
全部评论
系统通不过
点赞 回复 分享
发布于 2021-12-06 11:48

相关推荐

不愿透露姓名的神秘牛友
今天 10:46
点赞 评论 收藏
分享
1 收藏 评论
分享
牛客网
牛客企业服务