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

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

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

select tag,difficulty,round(avg(score),1) as clip_avg_score
from(
select tag,difficulty,score,ec.exam_id exam_id
from exam_record ec
join examination_info ei
on ec.exam_id = ei.exam_id
where difficulty = 'hard'
and score != '(NULL)') as t2
join
(select ec.exam_id exam_id,max(score) as max,min(score) as min
from exam_record ec
join examination_info ei
on ec.exam_id = ei.exam_id
where difficulty = 'hard'
and score != '(NULL)'
group by ec.exam_id) as t1
on t1.exam_id = t2.exam_id
where score != max and score != min
group by t2.exam_id,tag,difficulty

神经病写法

全部评论

相关推荐

争当牛马还争不上
码农索隆:1.把简历改哈 2.猛投,狠投 3.把基础打牢 这样你在有机会的时候,才能抓住
点赞 评论 收藏
分享
06-26 15:33
青岛工学院 Java
积极的秋田犬要冲国企:他现在邀请我明天面试
点赞 评论 收藏
分享
05-16 11:16
已编辑
东华理工大学 Java
牛客73769814...:盲猜几十人小公司,庙小妖风大,咋不叫她去4️⃣呢😁
牛客创作赏金赛
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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