🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Recursive CTEs: all 15 questions

Quiz: Recursive CTEs · Question 11 of 15

How many rows does this CTE produce: WITH RECURSIVE t(n) AS (SELECT 10 UNION ALL SELECT n - 3 FROM t WHERE n 1) SELECT…

How many rows does this CTE produce: WITH RECURSIVE t(n) AS (SELECT 10 UNION ALL SELECT n - 3 FROM t WHERE n > 1) SELECT * FROM t?

  1. A.3
  2. B.4
  3. C.5
  4. D.It never stops
Answer & explanation

Correct answer: 4

10, 7, 4, 1 — when n is 1 the condition n > 1 fails and no new row is made.

Can you get the rest right without peeking?

Take the timed Quiz: Recursive CTEs quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →