Back-To-School Deals - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Simple CASE WHEN
Searched CASE WHEN
11. Searched CASE WHEN with NULLs – continued
CASE WHEN with aggregates
CASE WHEN with GROUP BY
Summary

Instruction

Okay, and what will happen to NULLs if you don't include IS NOT NULL in your CASE WHEN? They will be treated as those rows for which the ELSE part is executed. Let's check that.

Exercise

Show each candidate's ID, score in math and a third column which will show:

  • 'above average' for candidates with math score higher than 60.
  • 'below average' for candidates with math score equal to or less than 60.
  • For other results, show 'not available'.

The column names should be: id, score_math, and result. Note what happens to the rows with a NULL score.