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 SLA and Turnaround Time
00:00
5 left

SQL for SLA and Turnaround Time

MediumSQL · PostgreSQL

Problem

Write a SQL query to analyze operational performance by joining service delivery, staffing, and client tables, then calculate weekly SLA attainment and average turnaround time by team.

Use completed deliveries associated with active staff and active clients. SLA attainment means completion on or before the SLA deadline. Turnaround time is measured in hours from receipt to completion.

Output

  1. One row per team and Monday-based week.
  2. Return team, week_start, completed_deliveries, sla_attainment_pct, avg_turnaround_hours, and prior_week_sla_pct.
  3. Include only qualifying completed deliveries, order by team, then week_start.

Schema

service_deliveries
ColumnTypeDescription
delivery_idPKINTUnique service delivery identifier
staff_idINTAssigned staff member
client_idINTClient receiving the service
received_atTIMESTAMPTimestamp when work was received
completed_atTIMESTAMPTimestamp when work was completed
sla_due_atTIMESTAMPSLA completion deadline
staffing
ColumnTypeDescription
staff_idPKINTUnique staff identifier
employee_nameVARCHAR(100)Staff member name
teamVARCHAR(50)Operational team
employment_statusVARCHAR(20)Current employment status
clients
ColumnTypeDescription
client_idPKINTUnique client identifier
client_nameVARCHAR(120)Client name
industryVARCHAR(60)Client industry
client_statusVARCHAR(20)Current client status
Tablesservice_deliveriesstaffingclients
Interviewer

Your question is SQL for SLA and Turnaround Time. 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.