A CASE expression starts with visible input rows.

highlighted = computed this step

Base rows

A CASE expression starts with visible source rows.

base rows first\text{base rows first}

Read the input size

The table has 4 input rows.

input rows=4\text{input rows}=4

CASE-expression examples are tiny finite row transforms with SQL-style TRUE/FALSE/UNKNOWN logic; SQL dialect completeness, type coercion, optimizer behavior, indexing, and product claims are out of scope.

Base rows: base rowsnamescorestatusAda90activeBea40activeCalNULLactiveDee70paused CASE branch evaluationsourcevaluesevaluationsresultresultSource0[Ada, 90, active][{branch:0, truth:TRUE, chosen:yes}, {branch:1, truth:TRUE, chosen:no}]highbranch 01[Bea, 40, active][{branch:0, truth:FALSE, chosen:no}, {branch:1, truth:FALSE, chosen:no}]lowELSE2[Cal, NULL, active][{branch:0, truth:UNKNOWN, chosen:no}, {branch:1, truth:UNKNOWN, chosen:no}]lowELSE3[Dee, 70, paused][{branch:0, truth:FALSE, chosen:no}, {branch:1, truth:TRUE, chosen:yes}]midbranch 1 CASE output rowsnamescorestatusbucketAda90activehighBea40activelowCalNULLactivelowDee70pausedmid CASE factsfactvalueinputRowCount4branchCount2outputRowCount4firstTrueRows2elseRows2nullElseRows0unknownSkipped2rowOrdersource_order

Output adds a label

The CASE result is added beside each source row.

source row plus CASE result\text{source row plus CASE result}

Summary

CASE chooses one result value for each row.

one result per row\text{one result per row}