题解 | #对试卷得分做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

全部评论

相关推荐

02-19 19:57
门头沟学院 Java
点赞 评论 收藏
分享
2024-12-23 06:50
门头沟学院 Java
给点吧求求了:3点发的帖子,害怕😰
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务