Search ⌘K
Airbnb
Airbnb

Interview Core Track · Medium · 25 min

11. Analyze Host Listings and Booking Transactions

As an Airbnb data analyst, you have been asked to analyze the performance of hosts' listings in the past year. Your task is to **identify the top 10 listings...

Interview Core Track
Medium
25 min
joins
aggregation

Company labels are directional practice context, not official interview guidance.

Timer 00:00
Back to practice

Objective

Practice joins through a Airbnb-tagged business scenario.

Approach

Use this track to improve speed, edge-case handling, and accuracy under timed conditions.

Company context

Company labels are directional practice context, not official interview guidance.

Prereq: query basics
Prereq: filtering

As an Airbnb data analyst, you have been asked to analyze the performance of hosts' listings in the past year. Your task is to **identify the top 10 listings with the most bookings.** There are two tables involved. One is the 'hosts' table that provides details about each host and its respective listing. The other one is 'bookings' table that records each booking transaction. hosts **Example Input:** host_id listing_id listing_name city --------------------------------------------- 101 201 Penthouse New York 102 202 Ocean View San Francisco 103 203 Country House Austin bookings **Example Input:** booking_id user_id listing_id booking_date ----------------------------------------------- 301 401 201 06/08/2022 302 402 202 06/10/2022 303 403 202 07/10/2022 304 404 203 08/08/2022 305 405 201 09/08/2022 Remarks: Both tables can be joined on the 'listing_id' field. **Answer:** SELECT listing_id, listing_name, COUNT(booking_id) AS number_of_bookings FROM hosts h LEFT JOIN bookings b USING(listing_id) GROUP BY 1, 2 ORDER BY 3 DESC LIMIT 10; ---

Pro question
This is a Pro question

Upgrade to Pro to unlock this prompt, the SQL workspace, and all 254 problems.

Upgrade to Pro — unlock all 254 problems
Editor
SQL workspace

Run queries against the protected question data, then submit once the result shape looks right.

Sign in to run SQL

Create a free account or sign in before running queries against protected question data.