题解 | #得分不小于平均分的最低分#

得分不小于平均分的最低分

https://www.nowcoder.com/practice/3de23f1204694e74b7deef08922805b2

select min(er.score) as min_score_over_avg
# 获取符合列最小的数
from exam_record er 
join examination_info ei using(exam_id)
where tag = 'SQL' AND score >=
(
    select avg(e1.score)
    from exam_record e1 
    join examination_info e2 using(exam_id)
    where tag = 'SQL'
)
# 选中sql类,分数大于平均分,这里的平均分用子查询获取直接使用


全部评论

相关推荐

02-26 09:15
已编辑
蚌埠学院 golang
点赞 评论 收藏
分享
03-05 16:22
已编辑
西安邮电大学 Web前端
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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