About the “Organizational Chart Hierarchy with SELF JOIN” SQL Problem
Business Scenario
During company-wide re-org planning, HR needs a consolidated management report displaying each employee alongside the full name of their direct manager. For top executives with no manager, display 'Executive Board'.
Expected Output & Criteria
Org chart hierarchy showing employee name, title, and manager name.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE employees (
emp_id INT PRIMARY KEY,
full_name VARCHAR(100) NOT NULL,
job_title VARCHAR(80) NOT NULL,
manager_id INT REFERENCES employees(emp_id)
);Target SQL Clauses & Operators
JOINCOALESCEORDER BY
Want more Joins practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.