A comparison can be TRUE, FALSE, or UNKNOWN.

highlighted = computed this step

Comparison predicates

A comparison such as qty greater than zero can be TRUE, FALSE, or UNKNOWN.

qty greater than zero\text{qty greater than zero}

Read comparison results

The comparison is TRUE for 2 rows and UNKNOWN for 1 row.

TRUE rows=2\text{TRUE rows}=2

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

Comparison predicates: base rowsitemqtystatuspen3opennotebook0openmug2closedstickerNULLopen predicate evaluationsourcevaluestruthkept0[pen, 3, open]TRUEyes1[notebook, 0, open]FALSEno2[mug, 2, closed]TRUEyes3[sticker, NULL, open]UNKNOWNno WHERE output rowsitemqtystatuspen3openmug2closed WHERE factsfactvalueinputRowCount4trueRows2falseRows1unknownRows1keptRows2droppedRows2rowOrdersource_orderunknownKeptno

NULL makes UNKNOWN

The row with NULL qty cannot answer qty greater than zero as TRUE or FALSE.

NULL comparison=UNKNOWN\text{NULL comparison}=\text{UNKNOWN}

Summary

A WHERE comparison keeps only rows that evaluate to TRUE.

TRUE survives\text{TRUE survives}