COALESCE starts with visible input rows.

highlighted = computed this step

Base rows

COALESCE starts with visible source rows.

read the row first\text{read the row first}

Show the input

The table has 4 source rows.

source rows=4\text{source rows}=4

COALESCE examples are tiny finite row transforms with SQL-style NULL choice behavior; SQL dialect completeness, type coercion, optimizer behavior, indexing, and product claims are out of scope.

Base rows: base rowsnameemailbackupnicknameAdaada@exampleada@backupNULLBeaNULLbea@backupBCalNULLNULLCalDeeNULLNULLNULL COALESCE argument choicesourcearg valueschosenIndexresultresultSource0[ada@example, ada@backup, missing]0ada@exampleemail1[NULL, bea@backup, missing]1bea@backupbackup2[NULL, NULL, missing]2missingliteral3[NULL, NULL, missing]2missingliteral COALESCE output rowsnameemailbackupnicknamecontactAdaada@exampleada@backupNULLada@exampleBeaNULLbea@backupBbea@backupCalNULLNULLCalmissingDeeNULLNULLNULLmissing COALESCE factsfactvalueinputRowCount4argCount3outputRowCount4firstArgRows1fallbackRows3literalDefaultRows2allNullRows0rowOrdersource_orderwhereContrastvalue_choice_not_truth_filter

One output per source row

The output keeps the same row order and adds one result column.

source order kept\text{source order kept}

Summary

A COALESCE result is chosen beside each input row.

one chosen value per row\text{one chosen value per row}