题解 | #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

全部评论

相关推荐

不愿透露姓名的神秘牛友
12-18 11:21
优秀的大熊猫在okr...:叫你朋友入职保安,你再去送外卖,一个从商,一个从政,你们两联手无敌了,睁开你的眼睛看看,现在是谁说了算(校长在背后瑟瑟发抖)
选实习,你更看重哪方面?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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