Business analysis glossary
Common Table Expression (CTE)
What it is
A common table expression, or CTE, is a named temporary result defined with the WITH keyword at the start of an SQL query. Later parts of the query can use it like a table. Several CTEs can be chained, which makes complex queries easier to read in steps.
Why it matters
Long nested queries are hard to read, check and explain. CTEs break the logic into named steps that match how a business person describes the question. Analysts who write clear CTEs can share their queries with others and have the logic reviewed more easily.
Example
The analyst builds a churn query in three named steps: first the active subscribers last month, then the active subscribers this month, then the subscribers in the first list but not the second. Each step is a CTE with a clear name, and the product manager can follow the logic without help.