题解 | #SQL类别高难度试卷得分的截断平均值#

SQL类别高难度试卷得分的截断平均值

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

select
    tag tag,
    difficulty difficulty,
    round(avg(score), 1) clip_avg_score
from
    (
        select
            tag,
            difficulty,
            score,
            row_number() over (
                order by
                    score asc
            ) as rk_asc,
            row_number() over (
                order by
                    score desc
            ) as rk_desc
        from
            exam_record er
            join examination_info ei on ei.exam_id = er.exam_id
        where
            ei.tag = 'SQL'
            and ei.difficulty = 'hard'
            and er.score is not null
    ) t1
where
    rk_asc <> 1
    and rk_desc <> 1
group by
    tag,
    difficulty

全部评论

相关推荐

图源网络侵权删
dddooola:这个事情我去年8月就看到有人b站(up:程序员正义)在举报了,可能一直在查,这次是查明后的处分了
点赞 评论 收藏
分享
草稿猫编程:查看图片
点赞 评论 收藏
分享
01-26 22:20
已编辑
门头沟学院 Java
Java抽象带篮子:项目很nb了,现在好好准备八股和算法吧,早点找实习,可以看看我的置顶帖子。帖子里写了怎么改简历,怎么包装实习经历,还有2个高质量可速成的项目话术,和我的牛客八股笔记专栏
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务