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

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

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

select uid,exam_id,round(avg(gap2)) avg_new_score
from (
select uid,a.exam_id
,ifnull(100*(score-min(score)over(partition by a.exam_id))/(max(score)over(partition by a.exam_id)-min(score)over(partition by a.exam_id)),score) gap2
from exam_record a left join examination_info b
on a. exam_id = b.exam_id
where difficulty = 'hard'
and score is not null
) c
group by uid,exam_id
order by exam_id,avg_new_score desc;

全部评论

相关推荐

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

创作者周榜

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