Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
The very basics
Infinite looping
Processing trees with recursive CTEs
Processing graphs with recursive CTEs
Summary

Instruction

Good stuff! Let's do one more exercise. This time, you'll write the query from scratch. Before you start, let's first check out the new table.

Exercise

Instead of employees, we're now going to deal with departments from the table department.

Select all data from the table. It contains the following columns:

  • id – The ID of each department.
  • name – The name of the department.
  • part_of – The ID of the department one level up.