Menu
mediumGrab · subqueryBasic

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

drivers
idINT
nameTEXT
ratingNUMERIC(3,2)

Basic

The example input, expected output, and walkthrough for this question unlock with a Basic plan.

↑ Read the question

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.

See Basic plans

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 plans

RM 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 plans

RM 25/mo · cancel anytime

Keep going

Company names are trademarks of their respective owners, used here only to describe practice material. mahir_data is not affiliated with, endorsed by, or sponsored by any company named on this site. Terms.