Self Join Employees Table for Salaries

Find all employees along with their manager's salary.

sql

SELECT e.name AS employee_name, m.salary AS manager_salary FROM employees e JOIN employees m ON e.manager_id = m.id;

This query performs a self-join on the "employees" table to associate each employee with their respective manager and retrieves the manager's salary.

PromptDB can make mistakes. Please double-check responses.