Skip to content

Commit 3a79a63

Browse files
authored
Create find-cutoff-score-for-each-school.sql
1 parent f1b3b24 commit 3a79a63

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Time: O(n * m)
2+
# Space: O(n * m)
3+
4+
SELECT school_id, IFNULL(min(score), -1) as score
5+
FROM Schools LEFT JOIN Exam ON capacity >= student_count
6+
GROUP BY school_id
7+
ORDER BY NULL;

0 commit comments

Comments
 (0)