Expected CTE facts are assertions only.

highlighted = computed this step

Honest by construction

Expected CTE facts are assertions only.

compiler is source of truth\text{compiler is source of truth}

Render checked rows

The guarded body query renders 3 rows after recomputation.

checked body rows=3\text{checked body rows}=3

CTE examples are tiny finite-table transforms; recursive CTEs, materialization claims, optimizer behavior, SQL dialect completeness, and database-product claims are out of scope.

Honest by construction: base Studentssidnamestatus1Adaactive2Beapaused3Calactive Honest by construction: base Scoressidscore1A1A23C4D Honest by construction: CTE ActiveStudentssidstudent1Ada3Cal Honest by construction: body outputleft.sidleft.scoreright.sidright.student1A1Ada1A21Ada3C3Cal CTE factsfactvaluebaseTableCount2cteCount1cteNames[ActiveStudents]bodyRowCount3bodyColumnCount4referencedCtes[ActiveStudents]rowOrdersource_orderrecursivenomaterializedClaimnot_modeled

Try to tamper

Wrong expected facts, derived sidecars, duplicate names, missing references, recursive/materialized claims, bools, and floats fail closed.

tamper rejected\text{tamper rejected}

Summary

The book shows exact finite non-recursive CTE behavior only; product SQL behavior is outside the model.

scoped CTE model\text{scoped CTE model}