Logistics & Transportation Analytics · Mission 7 of 30Easy

Total freight spend

SUM multiple cost columns to compute total spend

The Brief

Priya KapoorFreight Finance Leadlogistics-ops

I'm closing the books for the period. Give me total freight spend across all shipments: sum `freight_cost` as `total_linehaul`, sum `fuel_surcharge` as `total_fuel`, sum `accessorial_cost` as `total_accessorial`, and also compute the grand total as `total_spend`. One row, four columns.

You'll practice

SUM

Tables & columns available

fact_shipmentsfact15 columns
ColumnTypeKey
shipment_idINTPK
carrier_idINTFK → dim_carriers
lane_idINTFK → dim_lanes
planned_pickup_dateTEXT
actual_pickup_dateTEXT
planned_delivery_dateTEXT
actual_delivery_dateTEXT
qty_orderedINT
qty_shippedINT
weight_lbsREAL
freight_costREAL
fuel_surchargeREAL
accessorial_costREAL
dwell_hours_at_originREAL
statusTEXT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Use SUM() on each of the three cost columns separately.

Hint 2

Compute total_spend as the sum of all three: freight_cost + fuel_surcharge + accessorial_cost.

Hint 3

No GROUP BY — you want a single aggregate row across the whole table.