SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

First Booking Channel Mix

Unsolved

Airbnb's marketing team wants to credit each user's acquisition to the channel of their first booking. A user's first booking is the one with the earliest booking_date; if a user made several bookings on that date, the one with the lowest booking_id is first. pct_of_users is the share of all users who have made a booking, times 100. Write an SQL query that returns channel, first_bookings (the number of users whose first booking came through that channel) and pct_of_users rounded to 2 decimal places. Order the results by first_bookings descending, then channel ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
🏢 Airbnb

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM bookings
Full source dataset
12 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine