Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL Inner Join Matching Rows

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is SQL Inner Join Matching Rows. Start with the requirements and the one table on the right.

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.

Problem

Avnet's component fulfillment workflow records the matching status of shipment requests. Write a PostgreSQL query that returns only shipment records whose status is Matched.

Requirements

  1. Return the shipment ID, requested part number, and matching status.
  2. Include only rows where status equals Matched.
  3. Order the results by shipment_id in ascending order.

Schema

component_shipments
ColumnTypeDescription
shipment_idPKINTEGERUnique shipment request identifier
part_numberVARCHAR(30)Avnet component part number
customer_accountVARCHAR(40)Customer account name
statusVARCHAR(20)Shipment matching status
requested_quantityINTEGERQuantity requested
Tablescomponent_shipments
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results