SQL Semantics
WHERE Keeps Only TRUE
WHERE keeps TRUE rows and drops FALSE or UNKNOWN rows.
WHERE keeps only TRUE
A WHERE clause keeps rows whose predicate is TRUE. Rows whose predicate is FALSE or UNKNOWN are both dropped. Note: UNKNOWN is visible in the truth annotation.
Filtering grades
The grade threshold is 85 and the recomputed kept row count is 2. Note: the missing-grade row is dropped because its predicate is UNKNOWN, not TRUE.
SQL bag/multiset + three-valued NULL logic, deterministic but surprising; tiny finite tables; no engine/perf claims. Set algebra is Book 1.
Only TRUE survives
The compiled predicate annotations contain TRUE 2, FALSE 2, and UNKNOWN 1. The kept row count matches the TRUE count.
SQL bag/multiset + three-valued NULL logic, deterministic but surprising; tiny finite tables; no engine/perf claims. Set algebra is Book 1.
NULL does not vanish by itself
Filtering on course instead of grade recomputes to row count 3. Note: the row with NULL grade survives when the predicate is TRUE for its course.
SQL bag/multiset + three-valued NULL logic, deterministic but surprising; tiny finite tables; no engine/perf claims. Set algebra is Book 1.
Summary
WHERE keeps TRUE and drops both FALSE and UNKNOWN. Note: bag multiplicity and NULL behavior are here; set algebra was Book One.