The body query can read the named CTE result.

highlighted = computed this step

Reference the CTE

The body query can read from the named CTE result.

body reads CTE name\text{body reads CTE name}

Read the reference

The body references ActiveStudents and returns 2 rows.

body rows=2\text{body rows}=2

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

Reference the CTE: base Studentssidnamestatus1Adaactive2Beapaused3Calactive Reference the CTE: CTE ActiveStudentssidstudent1Ada3Cal Reference the CTE: body outputsidstudent1Ada3Cal CTE factsfactvaluebaseTableCount1cteCount1cteNames[ActiveStudents]bodyRowCount2bodyColumnCount2referencedCtes[ActiveStudents]rowOrdersource_orderrecursivenomaterializedClaimnot_modeled

Same rows

Here the body is just the CTE reference, so the body output matches the CTE output.

body = CTE ref\text{body = CTE ref}

Summary

A CTE reference is a named table lookup inside the scoped request.

name lookup\text{name lookup}