HomeInterview QuestionsWrite an SQL query that returns the employee name …

Write an SQL query that returns the employee name and the manager name for each employee.

🟢 Easy Coding Junior level
1Times asked
Jun 2026Last seen
Jun 2026First seen

💡 Model Answer

Assuming you have an Employees table with columns EmployeeID, EmployeeName, and ManagerID (which references EmployeeID of the manager), you can use a self‑join:

SELECT e.EmployeeName AS Employee,

   m.EmployeeName AS Manager

FROM Employees e

LEFT JOIN Employees m ON e.ManagerID = m.EmployeeID;

This joins each employee to their manager. If an employee has no manager, the Manager column will be NULL.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.

Get Assisting AI — Starts at ₹500