#787

Show every employee's path to the top

HR asked for a visual «path» from every employee up to the CEO as a string with arrows — e.g. «Anna → VP-Eng → CEO». A clean way to surface org depth. For every employee show their id, name, and the joined chain of names from themselves up to the top of the hierarchy. Sort by id. You'll need a recursive walk over the reporting tree.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.

idnamechain
1CEOCEO
2VP-EngVP-Eng → CEO
3VP-SalesVP-Sales → CEO

Your query result will appear here