Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLself-joinsSingle-choice MCQ

You want all unordered pairs of employees in the same department (each pair once, no self-pairing). Which self-join WHERE clause is correct?

-- pairs of coworkers in the same dept, each pair listed once SELECT a.name, b.name FROM emp a JOIN emp b ON a.dept_id = b.dept_id WHERE /* ??? */;