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 Ops Performance by Location
00:00
5 left

SQL Ops Performance by Location

HardSQL · PostgreSQL

Problem

Write a SQL query to analyze operational performance by location, including joins across orders, inventory, and staffing tables, and summarize key business metrics by week.

Use the supplied tables and calculate weekly order volume, ordered units, completed orders, fulfillment rate, inventory units, reserved units, staffing hours, and week-over-week order change.

Output

  1. One row per location and calendar week, including weeks present in any source table.
  2. Columns: location, week_start, total_orders, ordered_units, completed_orders, fulfillment_rate, inventory_units, reserved_units, staffing_hours, prior_week_orders, week_over_week_order_change.
  3. Order by location, then week_start ascending.

Schema

orders
ColumnTypeDescription
order_idPKINTUnique order identifier
locationVARCHAR(50)Operational location
order_dateDATEDate the order was placed
quantityINTUnits included in the order
statusVARCHAR(20)Order fulfillment status
inventory
ColumnTypeDescription
inventory_idPKINTUnique inventory snapshot identifier
locationVARCHAR(50)Inventory location
sku_codeVARCHAR(30)Stock keeping unit code
snapshot_dateDATEDate of the inventory snapshot
units_on_handINTAvailable physical units
units_reservedINTUnits reserved for orders
staffing
ColumnTypeDescription
staffing_idPKINTUnique staffing record identifier
locationVARCHAR(50)Staffing location
employee_idINTEmployee assigned to the shift
shift_dateDATEDate of the shift
hours_workedDECIMAL(6,2)Hours worked during the shift
Tablesordersinventorystaffing
Interviewer

Your question is SQL Ops Performance by Location. 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.