📞 0339-0387701 (WhatsApp) Contact

« Back to Database & Data Handling (NCCIA)

Which statement finds employees and their managers using a self join?

A. SELECT E.Name, M.Name FROM Employees E INNER JOIN Employees M ON E.ManagerID = M.EmpID ✅
B. SELECT E.Name FROM Employees E JOIN Managers M
C. SELECT E.Name, M.Name FROM Employees E, Managers
D. SELECT E.Name FROM Employees WHERE ManagerID = Name

Correct Answer: A. SELECT E.Name, M.Name FROM Employees E INNER JOIN Employees M ON E.ManagerID = M.EmpID

Explanation

The employee row E is matched to the manager row M whose EmpID equals the employee's ManagerID.