Bird
0
0

Which part of a Recursive CTE defines the stopping condition?

easy📝 Conceptual Q2 of 15
SQL - Common Table Expressions (CTEs)
Which part of a Recursive CTE defines the stopping condition?
AThe anchor member query
BThe recursive member query
CThe UNION or UNION ALL clause
DThe final SELECT statement
Step-by-Step Solution
Solution:
  1. Step 1: Identify stopping condition in recursive CTE

    The recursive member query runs repeatedly until no new rows are returned, which acts as the stopping condition.
  2. Step 2: Analyze options

    The anchor member initializes the recursion, UNION combines results, and final SELECT retrieves data, but stopping depends on recursive member.
  3. Final Answer:

    The recursive member query -> Option B
  4. Quick Check:

    Stopping condition = recursive member query [OK]
Quick Trick: Stopping happens when recursive query returns no new rows [OK]
Common Mistakes:
  • Thinking anchor member controls recursion end
  • Confusing UNION with stopping condition
  • Assuming final SELECT stops recursion

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes