0
← Exercises/
Joins•4 of 12
JoinsIntermediatePRO

Missing Inbound Supplier Shipments with LEFT JOIN

Scenario

Warehouse inventory control issues purchase orders (POs) to product vendors. The inventory manager needs to identify open purchase orders that have zero receiving records logged at the fulfillment dock.

Task
Join `supplier_pos` with `warehouse_receipts` using a `LEFT JOIN` to identify purchase orders that have never been received. Return: 1. `po.po_number` 2. `po.vendor_name` 3. `po.total_order_cost` 4. `po.expected_delivery_date` Filter to only retain purchase orders where `r.receipt_id IS NULL`. Order results by `po.expected_delivery_date` ascending.
Expected Output Format

List of unreceived purchase orders sorted chronologically by expected delivery date.

Input Tables & Sample Data0 tables
Loading database schema...
Need a hint?
query.sql|Local Sandbox
Loading SQL editor...
Click "Run" or press ⌘ + Enter to execute your query

About the “Missing Inbound Supplier Shipments with LEFT JOIN” SQL Problem

Business Scenario

Warehouse inventory control issues purchase orders (POs) to product vendors. The inventory manager needs to identify open purchase orders that have zero receiving records logged at the fulfillment dock.

Expected Output & Criteria

List of unreceived purchase orders sorted chronologically by expected delivery date.

Database Table Schema (PostgreSQL DDL)

PostgreSQL 16 WASM

This challenge executes directly against the following relational schema in your browser:

CREATE TABLE supplier_pos (
        po_number VARCHAR(20) PRIMARY KEY,
        vendor_name VARCHAR(100) NOT NULL,
        total_order_cost NUMERIC(10, 2) NOT NULL,
        expected_delivery_date DATE NOT NULL
      );

      CREATE TABLE warehouse_receipts (
        receipt_id INT PRIMARY KEY,
        po_number VARCHAR(20) REFERENCES supplier_pos(po_number),
        received_at TIMESTAMP NOT NULL,
        pallet_count INT NOT NULL
      );

Target SQL Clauses & Operators

LEFT JOINIS NULLORDER BY

Want more Joins practice?

Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.

View Joins Track→