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

Instruction

Okay. Let's do one more exercise for this topic.

Exercise

Count the number of candidates who scored:

  • at least 80 in math (good_math).
  • at least 60 (average_math).
  • or less than 60 (poor_math).

Show only those candidates who have provided a preferred_contact form.

Stuck? Here's a hint!

One of the counts is as follows:

COUNT(CASE WHEN score_math >= 80 THEN id END)
AS good_math