← SQL Analyst Starter

Lesson 4 of 4

Treat NULL explicitly

Distinguish missing values from zero and blank text.

Do the work

  1. NULL is an unknown value, not 0 or empty text.
  2. Use IS NULL rather than = NULL.
  3. Use COALESCE only when the output contract declares a default.

See the method

Riley has NULL email; Casey has an empty email.

Read every demonstration step
  1. Riley has NULL email; Casey has an empty email.
  2. IS NULL selects only Riley.
  3. COALESCE(region, 'Unknown') gives an explicit output label.

Practice independently

Take it further

Write separate diagnostics for NULL email and empty email.