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

SQL for Store Ops Performance

HardSQL · PostgreSQL

Problem

Write a SQL query to analyze store operations performance by week, joining sales, inventory, and labor tables to identify locations with high shrink and low recovery scores at Michaels.

Use a shrink rate above 2% and a recovery score below 70 as the identification thresholds. Include prior-week comparisons when available.

Output

  1. One row per qualifying store and week.
  2. Return store_id, week_start, net_sales, shrink_value, shrink_rate, recovery_score, labor_hours, prior_week_shrink_rate, and recovery_score_change.
  3. Sort by week_start ascending, shrink_rate descending, and store_id ascending.

Schema

sales
ColumnTypeDescription
sale_idPKINTUnique sale identifier
store_idINTMichaels store identifier
sale_dateDATEDate of the sale
net_salesNUMERIC(12,2)Net sales amount
inventory
ColumnTypeDescription
inventory_idPKINTUnique inventory record identifier
store_idINTMichaels store identifier
inventory_dateDATEDate of the inventory observation
shrink_valueNUMERIC(12,2)Value of inventory shrink
recovery_scoreNUMERIC(5,2)Inventory recovery score from 0 to 100
labor
ColumnTypeDescription
labor_idPKINTUnique labor record identifier
store_idINTMichaels store identifier
labor_dateDATEDate the labor was recorded
hours_workedNUMERIC(8,2)Labor hours worked
Tablessalesinventorylabor
Interviewer

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