Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Top Taskers by Category
00:00
5 left

Top Taskers by Category

MediumSQL · PostgreSQL

Problem

TaskRabbit wants to identify the highest-earning taskers in each service category. Write a SQL query that ranks taskers by revenue from completed bookings during the previous calendar month, using September 15, 2026 as the reporting reference date.

Output

  1. Return one row per qualifying tasker and category, with category_name, tasker_id, tasker_name, total_revenue, and revenue_rank.
  2. Include only completed bookings from August 2026, excluding bookings with missing tasker or category matches.
  3. Return the top three taskers in each category, with ties broken by the lower tasker_id.
  4. Sort by category_name, then revenue_rank, then tasker_id.
  5. NULL booking amounts are ignored by SUM; taskers with only NULL amounts remain eligible with a NULL total revenue.

Schema

taskers
ColumnTypeDescription
tasker_idPKINTUnique Tasker identifier
tasker_nameVARCHAR(100)Tasker display name
service_areaVARCHAR(100)Primary service area
categories
ColumnTypeDescription
category_idPKINTUnique task category identifier
category_nameVARCHAR(100)Task category name
bookings
ColumnTypeDescription
booking_idPKINTUnique booking identifier
tasker_idINTTasker assigned to the booking
category_idINTCategory associated with the booking
amountDECIMAL(10,2)Booking revenue amount
statusVARCHAR(20)Booking status
completed_atTIMESTAMPTimestamp when the booking was completed
Tablestaskerscategoriesbookings
Interviewer

Your question is Top Taskers by Category. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.