Question

Consider a self-join query to find all pairs of employees who have the same manager:     SELECT e1.name, e2.name FROM Employees e1, Employees e2     WHERE e1.mgr_id = e2.mgr_id AND e1.emp_id <> e2.emp_id; Why is the condition "e1.emp_id <> e2.emp_id" necessary?

A To improve query performance only
B To prevent each employee from being paired with themselves
C It is not necessary; the query works identically without it
D To ensure mgr_id is never NULL
E To sort the results alphabetically
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)