Management & CommerceVery hardBusiness analyst · SQL test

Using the same table v, what does CASE WHEN amt >= 100 THEN 'High' WHEN amt >= 50 THEN 'Mid' ELSE 'Low' END return for customers C and D?

  1. A. C: Mid; D: NULL
  2. B. C: Mid; D: Low
  3. C. C: High; D: Low
  4. D. C: Low; D: NULL

Correct answer: B. C: Mid; D: Low

CASE takes the first branch that is true. For C (50), the first test fails and the second succeeds: 'Mid'. For D (NULL), both comparisons are unknown, not true, so the ELSE branch applies: 'Low'. Without an ELSE it would return NULL.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic