Data Cleaning Reps

← All exercises

Give blanks a real label

IntermediateNULLIF, COALESCEVehicle fuel economy (FuelEconomy.gov, model years 2010–2027)

Count records per technology type, showing blank atv_type as Conventional. Return label and count, largest first.

Hint

COALESCE(NULLIF(atv_type, ''), 'Conventional') turns '' into NULL, then NULL into a label.

Same question in Excel / Google Sheets

Helper column =IF(K2="","Conventional",K2), then pivot.

Download the CSV from the datasets page. Column letters assume the CSV opens with its header in row 1.

Tip: Ctrl+Enter (⌘+Enter on Mac) checks your answer. Everything runs in your browser; nothing you type is sent anywhere.

← Blank is not NULLHow many ways to say 'drive type'? →