advanced
Hierarchical Data Querying
Construct a complex SQL query using Recursive Common Table Expressions.
📝 Contenu du Prompt
Given a standard SQL schema for an employee management system containing an 'employees' table with columns 'id', 'name', and 'manager_id', write a recursive Common Table Expression (CTE) query. The query should return the organizational hierarchy for a specific employee ID, listing all direct and indirect reports in a depth-indented format, along with their total count of subordinates at every level.