▸_sqlgym

13. Build the Org Path

MediumRecursive CTEsWITH RECURSIVEstring accumulationpath

Using the same employees org chart, build a breadcrumb path from the CEO down to each employee.

Task: return each employee's name and a path string of names from the CEO to that employee, joined with >. For example Frank reports to Dan who reports to Bob who reports to Alice, so his path is Alice > Bob > Dan > Frank. Order by path.

Tables
Loading schema…
Expected outputrows must come back in this order
Computing expected output…

This is the result for the example data above. On Submit your query is graded against this example plus 4 hidden edge cases 5test cases in all. A sloppy query that only fits the example won't pass.

SQL
⌘/Ctrl+↵ run · ⇧⌘/Ctrl+↵ submit
Run a query to see its output here.