题解 | #得分不小于平均分的最低分#
得分不小于平均分的最低分
https://www.nowcoder.com/practice/3de23f1204694e74b7deef08922805b2
-- 得分不小于平均分的最低分 -- 请从试卷作答记录表中找到SQL试卷得分不小于该类试卷平均得分的用户最低得分 -- 1.先筛选出得分不为空的选项 -- 2.然后通过avg()或者是sum() / count()求平均分 -- 3.从小于平均分中的选项中通过min()求出最低分 -- 4.使用内连接插叙SQL类型的考试 select min(score) as min_score_over_avg from exam_record join examination_info using (exam_id) where tag = 'SQL' and score >= ( select sum(score) / count(score) from exam_record join examination_info using (exam_id) where tag = 'SQL' and score is not null )