-- Fictional learning example. Run only in a fresh, disposable local database. -- Verified with SQLite. No real customer or production records. CREATE TEMP TABLE repair_jobs ( job_id INTEGER PRIMARY KEY, service TEXT NOT NULL, status TEXT NOT NULL, estimated_minutes INTEGER ); INSERT INTO repair_jobs VALUES (101, 'tune_up', 'queued', 45), (102, 'puncture', 'ready', 20), (103, 'tune_up', 'queued', 60), (104, 'brake_adjust', 'queued', 30), (105, 'puncture', 'cancelled', 15), (106, 'tune_up', 'queued', NULL); SELECT job_id, service, estimated_minutes FROM repair_jobs WHERE status = 'queued' ORDER BY job_id; SELECT service, COUNT(*) AS jobs, COUNT(estimated_minutes) AS estimates_known, SUM(estimated_minutes) AS minutes_known FROM repair_jobs WHERE status = 'queued' GROUP BY service ORDER BY jobs DESC, service; -- Expected IDs: 101, 103, 104, 106 -- Expected summary: tune_up | 3 | 2 | 105; brake_adjust | 1 | 1 | 30 -- Overall: 4 queued jobs, 3 known estimates, 135 known estimated minutes.