Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SQL Warehouse Performance Analysis
00:00
5 left

SQL Warehouse Performance Analysis

MediumSQL · PostgreSQL

Problem

Write a SQL query to analyze warehouse performance by site, shift, and day, including throughput, accuracy, and labor cost per unit.

Use the supplied warehouse, shift performance, and labor tables. Include valid warehouse-site records across all available dates.

Output

  1. One row per site, shift, and work date.
  2. Columns: site_code, work_date, shift_name, throughput_units, accuracy_percentage, and labor_cost_per_unit.
  3. Sort by site_code, work_date, and shift_name ascending. Return NULL when a metric cannot be calculated.

Schema

warehouse_sites
ColumnTypeDescription
site_idPKINTUnique warehouse identifier
site_codeVARCHAR(10)Operational warehouse code
site_nameVARCHAR(100)Warehouse name
shift_performance
ColumnTypeDescription
performance_idPKINTUnique performance record identifier
site_idINTWarehouse identifier
shift_nameVARCHAR(20)Operational shift name
work_dateDATEDate of the shift
units_processedINTUnits processed during the shift
units_accurateINTUnits processed accurately
labor_entries
ColumnTypeDescription
labor_entry_idPKINTUnique labor entry identifier
site_idINTWarehouse identifier
shift_nameVARCHAR(20)Operational shift name
work_dateDATEDate of the labor entry
labor_hoursNUMERIC(8,2)Paid labor hours
hourly_rateNUMERIC(8,2)Hourly labor rate
Tableswarehouse_sitesshift_performancelabor_entries
Interviewer

Your question is SQL Warehouse Performance 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.