The name path from the top to an employee
For each employee in emp, build the chain of names from the topmost manager down to them, joined by > (e.g. CEO > VP-Eng > EngMgr). Return id and path, ordered by id.
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.
| id | path |
|---|---|
| 1 | CEO |
| 2 | CEO > VP-Eng |
| 3 | CEO > VP-Sales |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in