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
Dispatch Completion SQL Analysis
00:00
5 left

Dispatch Completion SQL Analysis

MediumSQL · PostgreSQL

Problem

Write a SQL query to compare planned dispatches versus actual completed loads by day and region, and flag regions where completion rate fell below target.

Use the provided tables and include days with planned dispatches but no completed loads, as well as completed loads without plans.

Output

  1. One row per day and region with activity_date, region_name, planned_dispatches, completed_loads, completion_rate, and below_target
  2. Include all activity dates, calculate a zero completion rate when no dispatches were planned, and flag rates below the region target
  3. Order by activity_date, then region_name

Schema

regions
ColumnTypeDescription
region_idPKINTUnique regional identifier
region_nameVARCHAR(100)Region display name
target_completion_rateNUMERIC(5,4)Minimum acceptable completed-to-planned load ratio
planned_dispatches
ColumnTypeDescription
dispatch_idPKINTUnique planned dispatch identifier
dispatch_dateDATEDate on which the dispatch was planned
region_idINTRegion responsible for the planned dispatch
completed_loads
ColumnTypeDescription
load_idPKINTUnique completed load identifier
completion_dateDATEDate on which the load was completed
region_idINTRegion associated with the completed load
Tablesplanned_dispatchescompleted_loadsregions
Interviewer

Your question is Dispatch Completion SQL Analysis. Start with the requirements and the three 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.