Drivers rated above average
Grab wants to spotlight its best-rated drivers.
From the drivers table, return the name and rating of every driver whose rating is strictly greater than the average rating across all drivers.
Schema
| id | INT |
| name | TEXT |
| rating | NUMERIC(3,2) |
Basic
The example input, expected output, and walkthrough for this question unlock with a Basic plan.
Basic
The reference solution and walkthrough for this question unlock with a Basic plan.
Basic
This is a Basic question
Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.
RM 25/mo · cancel anytime
The interviewer's next question
Instead of filtering, show every driver next to the average: return name, rating, and diff_from_avg (rating minus the average, rounded to 2 decimals) for all drivers.
Solving follow-ups — the questions an interviewer actually asks next — unlocks with a Basic plan.
See Basic plansRM 25/mo · cancel anytime
Ops just wants a single headline number: how many drivers are rated below average? Return one row, count_below_avg.
Solving follow-ups — the questions an interviewer actually asks next — unlocks with a Basic plan.
See Basic plansRM 25/mo · cancel anytime