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

Instruction

Fine work! Let's do one more exercise. This time, you'll have to write the query from scratch. Before you proceed to writing the query, you'll have to learn a 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,
  • PartOf – the ID of the department one level up.