Introduction
Simple CASE WHEN
Searched CASE WHEN
11. Searched CASE WHEN with NULLs – continued
CASE WHEN with aggregates
CASE WHEN with GROUP BY
Revision

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 too or less than 60.
  • For other results, show 'not available'.

Note what happens to the rows with a NULL score.

Console

Code editor

Result

TableConsole