About the “Active Rideshare Drivers with Expired Vehicle Inspections” SQL Problem
Business Scenario
City transportation regulators audit rideshare platforms to ensure that any driver marked 'active' is operating an inspected vehicle whose safety certification has not lapsed.
Expected Output & Criteria
Active drivers operating vehicles with expired safety inspection certificates.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMCREATE TABLE vehicle_inspections (
vehicle_id INT PRIMARY KEY,
license_plate VARCHAR(12) NOT NULL,
days_since_inspection INT NOT NULL,
inspection_status VARCHAR(20) NOT NULL
);
CREATE TABLE rideshare_drivers (
driver_id INT PRIMARY KEY,
driver_name VARCHAR(100) NOT NULL,
vehicle_id INT REFERENCES vehicle_inspections(vehicle_id),
driver_status VARCHAR(20) NOT NULL
);Target SQL Clauses & Operators
Want more Joins practice?
Explore the full syllabus of 16 exercises and syntax guides.