Summer Deals - hours only!Up to 80% off on all courses and bundles.-Close
The very basics
8. Basic recursion: exercise
Infinite looping
Processing graphs with recursive CTE


Excellent. Let's do an additional exercise to practice.


Create a recursive query that will show three columns:

  • num - even numbers from 2 to 20,
  • num_plus_prev - that number plus the previous number,
  • num_square - the number squared.

Stuck? Here's a hint!

In order to get squared values, multiply the value by itself.