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 Inventory Intake vs Sales Floor
00:00
5 left

SQL Inventory Intake vs Sales Floor

MediumSQL · PostgreSQL

Problem

Write a SQL query to compare inventory intake versus items moved to the sales floor by day.

Use the provided intake and sales-floor movement tables. Include dates appearing in either table, treating missing activity as zero. Preserve days where a quantity is NULL and ensure the result is ordered chronologically.

Output

  1. One row per calendar day
  2. Columns: activity_day, intake_units, moved_units, variance_units, and status
  3. variance_units is intake minus moved, and status identifies whether intake exceeds moves, moves exceed intake, or they are balanced
  4. Order by activity_day ascending

Schema

inventory_intake
ColumnTypeDescription
intake_idPKINTUnique inventory intake record identifier
item_skuVARCHAR(30)SKU received into inventory
received_atTIMESTAMPTimestamp when inventory was received
quantityINTNumber of units received
sales_floor_moves
ColumnTypeDescription
move_idPKINTUnique sales-floor movement identifier
item_skuVARCHAR(30)SKU moved to the sales floor
moved_atTIMESTAMPTimestamp when units were moved to the sales floor
quantityINTNumber of units moved
Tablesinventory_intakesales_floor_moves
Interviewer

Your question is SQL Inventory Intake vs Sales Floor. Start with the requirements and the two 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.