1988. Find Cutoff Score for Each School
Level: Medium
Question:
+-------------+------+
| Column Name | Type |
+-------------+------+
| school_id | int |
| capacity | int |
+-------------+------+
school_id is the primary key for this table.
This table contains information about the capacity of some schools.
The capacity is the maximum number of students the school can accept.+---------------+------+
| Column Name | Type |
+---------------+------+
| score | int |
| student_count | int |
+---------------+------+
score is the primary key for this table.
Each row in this table indicates that there are student_count students that got
at least score points in the exam.
The data in this table will be logically correct, meaning a row recording a
higher score will have the same or smaller student_count compared to a row
recording a lower score. More formally, for every two rows i and j in the table,
if scorei > scorej then student_counti <= student_countj.My Solution:
Last updated