Trace recursive CTEs through hierarchy levels

Distinguish one-hop self-joins from recursive CTE traversal and reason about frontiers, fixed points, duplicates and cycles. Subqueries and recursive queries · Databases.

A manager link gives one hop. A hierarchy query must explain where the traversal starts, how the next frontier is made, and why it eventually stops.

What you will learn

  • Separate the anchor and recursive member of a recursive CTE
  • Trace iterative frontiers and fixed-point termination
  • Predict how UNION, UNION ALL, duplicate paths and cycles affect traversal

Lesson outline

  1. Explicit hops versus arbitrary depth
  2. Anchor, member and frontier
  3. Duplicate paths and termination
  4. Engine-qualified search and cycle tools

19 minutes · 2 scenes · 0 predict checks · 10 quiz questions

The full lesson is available with Premium.