About the “Fleet Vehicle Compliance Audit with Multi-Table JOIN” SQL Problem
Business Scenario
Municipal transport authorities require rideshare networks to audit trips where the vehicle used was overdue for mandatory safety inspection.
Expected Output & Criteria
Trips performed with uninspected vehicles sorted by fare amount.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE drivers (
driver_id INT PRIMARY KEY,
driver_name VARCHAR(80) NOT NULL
);
CREATE TABLE vehicles (
vehicle_id INT PRIMARY KEY,
license_plate VARCHAR(20) NOT NULL,
model VARCHAR(50) NOT NULL,
inspection_passed BOOLEAN NOT NULL
);
CREATE TABLE rides (
ride_id INT PRIMARY KEY,
driver_id INT REFERENCES drivers(driver_id),
vehicle_id INT REFERENCES vehicles(vehicle_id),
fare_amount NUMERIC(8, 2) NOT NULL
);Target SQL Clauses & Operators
JOINWHEREORDER BY
Want more Joins practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.