Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SQL, Graphs, and Stats
00:00
5 left

SQL, Graphs, and Stats

MediumSQL · PostgreSQL

Problem

Tell me about a time you used SQL, graphs, and basic statistics to answer a business question at Booking.

Use the provided Booking search and booking data to demonstrate the SQL portion of your answer. Produce analysis-ready metrics that could support a chart and a concise business interpretation.

Output

  1. One row per month and acquisition channel
  2. Include month, channel, searches, converted_searches, conversion_rate, avg_revenue_per_search, and revenue_stddev
  3. Include channels with no bookings, sort by month ascending and channel ascending, with NULL channels last

Schema

booking_searches
ColumnTypeDescription
search_idPKINTUnique search event identifier
searched_atTIMESTAMPTimestamp when the search occurred
channelVARCHAR(50)Acquisition channel associated with the search
bookings
ColumnTypeDescription
booking_idPKINTUnique booking identifier
search_idINTSearch that led to the booking
booking_amountNUMERIC(10,2)Booking revenue amount
Tablesbooking_searchesbookings
Interviewer

Your question is SQL, Graphs, and Stats. 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.