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

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

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

with t1 as (
    select a.exam_id, b.score, a.tag, a.difficulty
    from examination_info a
    left join exam_record b
    on a.exam_id = b.exam_id
    where tag = 'SQL' and difficulty = 'hard'
)

select tag, difficulty,
round(avg(score),1) as clip_avg_score
from t1
where score not in (
    select max(score)
    from t1
    union all 
    select min(score)
    from t1
)

全部评论

相关推荐

群星之怒:不是哥们,你就不好奇瘫痪三十年的老植物人是啥样的吗?
点赞 评论 收藏
分享
03-26 15:18
已编辑
华北水利水电大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务