About the “Driver Earnings Quartile Segmentation with NTILE(4)” SQL Problem
Business Scenario
Fleet operations segments active gig couriers into earnings quartiles to benchmark hourly incentive schemes and tier bonuses.
Expected Output & Criteria
Drivers segmented into 4 earnings quartiles (1 = top 25%, 4 = bottom 25%).
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE driver_earnings (
driver_id INT PRIMARY KEY,
driver_name VARCHAR(80) NOT NULL,
weekly_payout NUMERIC(10, 2) NOT NULL
);Target SQL Clauses & Operators
NTILEOVERORDER BY
Want more Window Functions practice?
Explore the full syllabus of 14 exercises, syntax guides, and interview pitfalls.