COUNT(*) with a WHERE filter on a status column
Quick gut-check: how many shipments have a status of 'delivered'? Just give me the count — single number, label it `delivered_count`.
| Column | Type | Key |
|---|---|---|
| shipment_id | INT | PK |
| carrier_id | INT | FK → dim_carriers |
| lane_id | INT | FK → dim_lanes |
| planned_pickup_date | TEXT | |
| actual_pickup_date | TEXT | |
| planned_delivery_date | TEXT | |
| actual_delivery_date | TEXT | |
| qty_ordered | INT | |
| qty_shipped | INT | |
| weight_lbs | REAL | |
| freight_cost | REAL | |
| fuel_surcharge | REAL | |
| accessorial_cost | REAL | |
| dwell_hours_at_origin | REAL | |
| status | TEXT |
Each hint you reveal reduces the XP you can earn. Try the query first.
You're counting rows that match a condition, not summing a column.
Only one status value means the package actually arrived — filter the table to it.
Maya asked for one number — give the column a name that says what it represents.