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 Sell-Through
00:00
5 left

SQL for Store Sell-Through

MediumSQL · PostgreSQL

Problem

Write a SQL query to analyze weekly store performance by location, joining sales and inventory tables to identify stores with declining sell-through and low stock at Specialized Bicycle Components.

Treat low stock as total ending inventory below the store's total reorder point, and declining sell-through as lower than the prior available week.

Output

  1. One row per qualifying store and week, with location, week_start, sell_through, prior_sell_through, ending_stock, and reorder_point.
  2. Include only weeks meeting both conditions.
  3. Order by location, then week_start.

Schema

stores
ColumnTypeDescription
store_idPKINTUnique store identifier
locationVARCHAR(100)Store location
sales
ColumnTypeDescription
sale_idPKINTUnique sale identifier
store_idINTStore where the sale occurred
product_idINTProduct sold
sale_dateDATEDate of sale
units_soldINTUnits sold in the transaction record
inventory
ColumnTypeDescription
inventory_idPKINTUnique inventory snapshot identifier
store_idINTStore holding the inventory
product_idINTProduct being stocked
inventory_dateDATEDate of inventory snapshot
units_on_handINTUnits available at the snapshot
reorder_pointINTMinimum desired units for the product
Tablesstoressalesinventory
Interviewer

Your question is SQL for Store Sell-Through. 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.