SQLDAXExcelPython
LeaderboardRunLifetime
Interview classicsHard30 points

Levels in a hierarchy

Return EmployeeName and their level in the hierarchy. The head of sales, who has no manager, is level 1, their direct reports are level 2, and so on.

Hard questions are part of Lifetime and Pro. Read it here, and unlock running and checking your answer from the plans.

Show solutionLifetime

Runs in your browser with DuckDB, whose SQL is close to PostgreSQL. Nothing you type is sent to a server unless you save a score.

SQLselect text to run only that part
Loading editor…

Press Ctrl+Enter or Run to see the result here.