Skip to content

1988. Find Cutoff Score for Each School 👎

1
2
3
4
5
6
7
SELECT
  Schools.school_id,
  IFNULL(MIN(Exam.score), -1) AS score
FROM Schools
LEFT JOIN Exam
  ON (capacity >= student_count)
GROUP BY 1;