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
SQL: Top Hertz Locations by Revenue
00:00
5 left

SQL: Top Hertz Locations by Revenue

MediumSQL · PostgreSQL

Problem

Write a SQL query to identify the top-performing Hertz locations by revenue and rental volume over the last 30 days. Return the three highest-performing locations based on revenue, using rental volume and location name to break ties.

Output

  1. One row per qualifying Hertz location
  2. Columns: performance_rank, location_id, location_name, total_revenue, and rental_volume
  3. Include completed rentals dated within the last 30 days, including today
  4. Sort by performance_rank ascending

Schema

hertz_locations
ColumnTypeDescription
location_idPKINTEGERUnique Hertz rental location identifier
location_codeVARCHAR(20)Short Hertz location code
location_nameVARCHAR(100)Display name of the Hertz location
cityVARCHAR(80)City where the location operates
hertz_rentals
ColumnTypeDescription
rental_idPKINTEGERUnique rental transaction identifier
location_idINTEGERHertz location associated with the rental
rental_dateDATEDate the rental was recorded
revenueNUMERIC(12,2)Revenue attributed to the rental
rental_statusVARCHAR(20)Rental lifecycle status
Tableshertz_locationshertz_rentals
Interviewer

Your question is SQL: Top Hertz Locations by Revenue. Start with the requirements and the two 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.