About the “Multi-Leg Freight Hub Transit Connections” SQL Problem
Business Scenario
Freight dispatchers need to route cargo shipments between cities that don't have direct connections. They self-join flight route segments to find viable two-leg routes with a transfer hub.
Expected Output & Criteria
Two-leg transit routes from Chicago with layover hub and total flight hours.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE flight_routes (
route_id INT PRIMARY KEY,
origin_hub VARCHAR(30) NOT NULL,
dest_hub VARCHAR(30) NOT NULL,
flight_hours NUMERIC(4, 1) NOT NULL
);Target SQL Clauses & Operators
JOINONORDER BY
Want more Joins practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.