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

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

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

select min(t1.score) as min_score_over_avg
from exam_record as t1 join examination_info as t2
on t1.exam_id=t2.exam_id
where t2.tag='SQL'  and t1.score>=
(select avg(score) FROM exam_record where exam_id in 
 (select exam_id FROM examination_info where tag="SQL" )
 )

知识点:子查询

这里用到了where后边+子查询的用法:

select * from t1 where cod>(select....)
select * from t1 where cod in (select....)

全部评论

相关推荐

嗨害嗨我来了:感谢我吧,上次我在食堂敲打了一个姓雷的,他说马上给大学生们准备hc
不卡学历的大厂有哪些?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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