题解 | #统计复旦用户8月练题情况#
得分不小于平均分的最低分
http://www.nowcoder.com/practice/3de23f1204694e74b7deef08922805b2
思路:在表的右边加一列,填入平均值,再对新表过滤出大于平均值和SQL的行,取得分最小值就行了
select min(y.score) as min_score_over_avg from exam_record as y left join examination_info as ei using(exam_id) join ( select avg(score) as aa from examination_info join exam_record using(exam_id) where tag='SQL') as z where y.score>=z.aa and ei.tag='SQL'
查看29道真题和解析