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 for Business Case Studies
00:00
5 left

SQL for Business Case Studies

HardSQL · PostgreSQL

Problem

Tell me about a time you used SQL to solve a business problem, and walk me through how you validated your results.

For this exercise, use the booking records and reported daily metrics to demonstrate the SQL portion of that answer. Recalculate confirmed booking counts and values, compare them with the reported figures, and identify missing or mismatched records.

Output

  1. One row per date and market, including records present on only one side.
  2. Return metric_date, market, calculated and reported metrics, both differences, and validation_status.
  3. Sort by date ascending, then market ascending, with NULL markets last.

Schema

source_bookings
ColumnTypeDescription
booking_idPKINTUnique booking identifier
booking_dateDATEDate on which the booking was recorded
marketVARCHAR(20)Market associated with the booking
booking_statusVARCHAR(20)Booking lifecycle status
booking_valueNUMERIC(12,2)Value attributed to the booking
reported_daily_metrics
ColumnTypeDescription
metric_datePKDATEDate of the reported metric
marketPKVARCHAR(20)Market represented by the report
reported_bookingsINTBooking count from the report
reported_valueNUMERIC(12,2)Booking value from the report
Tablessource_bookingsreported_daily_metrics
Interviewer

Your question is SQL for Business Case Studies. 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.