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 Onboarding Progress Tracking
00:00
5 left

SQL Onboarding Progress Tracking

HardSQL · PostgreSQL

Problem

Write a SQL query to track onboarding progress by client, including shipment counts, delay rates, and 30-day trend changes across accounts.

Use the data through April 30, 2024. A shipment is delayed when it was delivered after its promised date or remains undelivered after its promised date. Compare March 31 through April 29 with March 1 through March 30.

Output

  1. One row per client, including clients with no qualifying shipments.
  2. Return client_id, client_name, onboarding_status, total and delayed shipment counts, overall delay rate, current and prior 30-day shipment counts, shipment count change, and delay-rate change in percentage points.
  3. Sort by client_id ascending. Return rates rounded to two decimal places.

Schema

clients
ColumnTypeDescription
client_idPKINTUnique client identifier
client_nameVARCHAR(100)Client account name
onboarding_statusVARCHAR(30)Current onboarding status
shipments
ColumnTypeDescription
shipment_idPKINTUnique shipment identifier
client_idINTClient associated with the shipment
shipment_dateDATEDate the shipment was created
promised_delivery_dateDATEPromised delivery date
delivered_dateDATEActual delivery date, or NULL if not delivered
Tablesclientsshipments
Interviewer

Your question is SQL Onboarding Progress Tracking. 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.