Ravindra BagaleCourses & study guides Track your progress

7. NULL Values: Missing Data Done Right

7.1 What NULL Means (Unknown — Not Zero, Not Blank Text)

Why. Treating missing as zero invents fake money and fake averages.

What. NULL means unknown / missing. It is not 0 and not empty text ''.

How. Look at orders.note — many rows are NULL on purpose in raja_coffee.

Steps

  1. Browse orders and find blank note cells.
  2. Say: this is NULL, not zero.
  3. Never replace NULL with 0 unless the business says so.

Examples

Example 1 · dataset: raja_coffee

SELECT order_id, note FROM orders WHERE order_id IN (1001,1003,1013);

Output

order_idnote
1001
1003gift
1013office stock

Meaning. Some notes filled, some NULL (shown blank).

Ravindra Bagale's Tip

NULL is a status of the cell, not a value you typed.