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
Store Performance SQL Analysis
00:00
5 left

Store Performance SQL Analysis

MediumSQL · PostgreSQL

Problem

Write a SQL query to analyze store performance by week, joining sales, payroll, and inventory tables to calculate sell-through and labor efficiency.

Return weekly results for stores with sales activity. Sell-through is units sold divided by units sold plus ending inventory, expressed as a percentage. Labor efficiency is net sales divided by labor hours.

Output

  1. One row per store and week, with store_id, week_start, net_sales, units_sold, labor_hours, labor_efficiency, ending_inventory, and sell_through_pct.
  2. Include missing inventory as null metrics where applicable, and order by store_id, then week_start.

Schema

sales
ColumnTypeDescription
sale_idPKINTUnique sales transaction identifier
store_idVARCHAR(10)American Eagle store identifier
sale_dateDATETransaction date
units_soldINTUnits sold in the transaction
net_salesNUMERIC(12,2)Net sales amount after discounts
payroll
ColumnTypeDescription
payroll_idPKINTUnique payroll record identifier
store_idVARCHAR(10)American Eagle store identifier
shift_dateDATEDate worked
labor_hoursNUMERIC(8,2)Paid labor hours
inventory
ColumnTypeDescription
inventory_idPKINTUnique inventory snapshot identifier
store_idVARCHAR(10)American Eagle store identifier
skuVARCHAR(20)Stock keeping unit
week_startDATEMonday starting the inventory week
units_on_handINTUnits available at the weekly snapshot
Tablessalespayrollinventory
Interviewer

Your question is Store Performance 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.