Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Regional Rental Revenue Summary

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Regional Rental Revenue Summary. Start with the requirements and the two tables on the right.

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.

Problem

Write a PostgreSQL query that joins Hertz rental transactions to Hertz location data and summarizes completed rental revenue by region. Keep transactions with missing location matches by grouping them under Unknown, and include a count of those unmatched transactions in the output.

Schema

ColumnTypeDescription
transaction_id
reservation_code
pickup_location_id
rental_date
status
revenue_amount
ColumnTypeDescription
location_id
location_name
region
Tablesrental_transactionslocations
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results