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

select
    tag,
    difficulty,
    round(avg(score), 1) clip_avg_score
from
    test.examination_info ei
    join test.exam_record er on ei.exam_id = er.exam_id
where
    tag = 'SQL'
    and difficulty = 'hard'
    and score not in (
        select
            min(score) score
        from
            test.examination_info ei
            join test.exam_record er on ei.exam_id = er.exam_id
        where
            tag = 'SQL'
            and difficulty = 'hard'
        union
        select
            max(score) score
        from
            test.examination_info ei
            join test.exam_record er on ei.exam_id = er.exam_id
        where
            tag = 'SQL'
            and difficulty = 'hard'
    )

全部评论

相关推荐

notbeentak...:真的nc,算毕业6月份,要给这种b公司打半年多白工😅
点赞 评论 收藏
分享
热爱生活的咸鱼在吃瓜:个人建议,项目太简单了,实习干的活都是测试的活,反正又没人知道你实习干啥了,你懂吧
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

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