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

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

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

求截断平均值,按照题目的要求我们直接去掉exam_id为9001中的最高值和最低值再求平均数即可。

select tag,difficulty,t.clip_avg_score 
from 
(select round(((sum(score)-max(score)-min(score))/(count(score)-2)),1) clip_avg_score,exam_id 
from exam_record 
where exam_id=9001 and score is not null) t join examination_info e 
on t.exam_id=e.exam_id;
全部评论

相关推荐

01-15 13:52
已编辑
河南大学 Java
六年要多久:标准头像,不吃香菜😂
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务