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 Bottleneck Analysis
00:00
5 left

SQL for Bottleneck Analysis

HardSQL · PostgreSQL

Problem

Write a SQL query to analyze operational performance by plant and month, joining production, inventory, and shipment tables to identify bottlenecks and late orders at TE Connectivity.

Use the provided production, inventory, and shipment tables. Return one row for every plant-month appearing in any table, including months without production.

Output

  1. Return plant_code, month, production totals, rejection rate, latest inventory quantities, shipment totals, late-order count, prior-month throughput change, and bottleneck_status.
  2. Sort by plant_code, then month ascending.

Schema

production
ColumnTypeDescription
production_idPKINTEGERUnique production record identifier
plant_codeVARCHAR(20)TE Connectivity manufacturing plant code
production_dateDATEDate of the production run
units_producedINTEGERUnits completed during the run
units_rejectedINTEGERUnits rejected during quality inspection
inventory
ColumnTypeDescription
inventory_idPKINTEGERUnique inventory snapshot identifier
plant_codeVARCHAR(20)TE Connectivity manufacturing plant code
snapshot_dateDATEDate of the inventory snapshot
raw_material_qtyINTEGERAvailable raw material quantity
finished_goods_qtyINTEGERAvailable finished goods quantity
shipments
ColumnTypeDescription
shipment_idPKINTEGERUnique shipment identifier
plant_codeVARCHAR(20)Plant responsible for the shipment
order_idVARCHAR(30)Customer order identifier
ship_dateDATEActual shipment date
promised_dateDATEPromised shipment date
units_shippedINTEGERUnits included in the shipment
Tablesproductioninventoryshipments
Interviewer

Your question is SQL for Bottleneck 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.