Ravindra BagaleCourses & study guides Track your progress

7. NULL Values: Missing Data Done Right

7.6 Practice: Missing Order Notes and Empty Ticket Fields

Why. Practice both datasets so NULL skills transfer.

What. Find, label and count NULLs on notes and ticket fields.

How. IS NULL → IFNULL for display → COUNT comparison.

Steps

  1. Missing notes count.
  2. Tickets with NULL priority.
  3. Tickets with NULL amount_eur.

Examples

Example 1 · dataset: interview_mini

SELECT COUNT(*) AS null_amount
FROM tickets
WHERE amount_eur IS NULL;

Output

null_amount
1

Meaning. One careful money NULL in the mini set.

Example 2 · dataset: interview_mini

SELECT agent, COUNT(*) AS openish
FROM tickets
WHERE status = 'Open'
GROUP BY agent;

Output

agentopenish
Elena2
James1
Omar1
Priya1

Meaning. Open tickets by agent (status is never NULL here).

Ravindra Bagale's Tip

Chala mitrano — write one interview answer about = NULL vs IS NULL tonight.