SQL pattern · P21 · 11 problems

Recursive CTEs and hierarchies

Graded problems on recursive CTEs and hierarchies, from easy to hard.

11 problems · about 2 h 30 min in all
Start with problem 01Depth of each employee in the org tree · 10 min
Learn it first · P21The join that finds only immediate childrenA single self-join follows one level; a recursive CTE repeats it to every descendant.Read the lesson →