Mockbit/#53
SQLeasyRanking~12m

A ride-sharing company wants to rank drivers by their average trip rating within...

Problem

A ride-sharing company wants to rank drivers by their average trip rating within each city for the month of January 2024. Return the driver ID, driver name, city, average rating (rounded to 2 decimal places), and their rank within the city. Drivers with the same average rating should receive the same rank, and the next rank should skip accordingly (standard competition ranking). Order results by city, then by rank ascending.

Examples

Example 1

Example 2

Constraints
  • Return columns: driver_id, driver_name, city, avg_rating, rank
  • Average rating rounded to 2 decimal places
  • Use RANK() for standard competition ranking
  • Filter for January 2024 trips only
  • Order by city, then rank ascending
Reference solution

Reference solution available after you attempt the question.

Ready to solve it?

Start a session on Mockbit #53. Write your SQL, run it against real data, and get graded on correctness, efficiency, query structure, and business understanding.

Related SQL questions
← Back homemockbit.io/q/53
PrivacyTerms© 2026 Mockbit