Closest SAT Scores
Start Timer
0:00:00
Given a table of students and their SAT test scores, write a query to return the two students with the closest test scores with the score difference.
If there are multiple students with the same minimum score difference, select the student name combination that is higher in the alphabet.
Example:
Input:
scores
table
Column | Type |
---|---|
id |
INTEGER |
student |
VARCHAR |
score |
INTEGER |
Output:
Column | Type |
---|---|
one_student |
VARCHAR |
other_student |
VARCHAR |
score_diff |
INTEGER |
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments