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 Weekly Operational Review
00:00
5 left

SQL for Weekly Operational Review

MediumSQL · PostgreSQL

Problem

Write an SQL query to analyze store performance at Albertsons by joining sales, labor, and inventory tables and summarizing key operational metrics by week.

Use the supplied tables and include all sales store-weeks in the requested date range. Treat missing labor or inventory records as zero for numeric totals, while preserving meaningful NULL inventory averages when no usable inventory quantity exists.

Output

  1. One row per store and Monday-based week beginning January 1, 2025 through January 14, 2025
  2. Columns: store_id, week_start, total_sales, total_units_sold, total_labor_hours, total_labor_cost, avg_inventory_units, stockout_days
  3. Order by store_id, then week_start ascending

Schema

sales
ColumnTypeDescription
sale_idPKINTUnique sales record identifier
store_idINTAlbertsons store identifier
sale_dateDATEDate of the sales record
net_salesNUMERIC(12,2)Net sales amount
units_soldINTUnits sold in the record
labor
ColumnTypeDescription
labor_idPKINTUnique labor record identifier
store_idINTAlbertsons store identifier
labor_dateDATEDate of the labor record
labor_hoursNUMERIC(8,2)Labor hours worked
labor_costNUMERIC(12,2)Labor cost for the record
inventory
ColumnTypeDescription
inventory_idPKINTUnique inventory record identifier
store_idINTAlbertsons store identifier
inventory_dateDATEDate of the inventory snapshot
inventory_unitsINTUnits available in inventory
stockout_flagBOOLEANWhether the store experienced a stockout
Tablessaleslaborinventory
Interviewer

Your question is SQL for Weekly Operational Review. 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.