← Amazon questions

SQL query for direct and indirect reportees

Filed under Amazon

Write an SQL query using common table expressions (CTEs) or recursion on an Employee table (empId, ManagerId) to retrieve all direct and indirect reportees for a given manager.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.