Question DB-SQL-0061
HardWhat does this query return for the table below?
Table emp:
| id | name | dept | salary | mgr |
|---|---|---|---|---|
| 1 | Anil | IT | 90000 | NULL |
| 2 | Bina | IT | 70000 | 1 |
| 3 | Chetan | HR | 50000 | 1 |
| 4 | Divya | IT | 70000 | 2 |
| 5 | Esha | HR | 65000 | 3 |
| 6 | Farhan | Sales | 55000 | 1 |
| 7 | Gita | Sales | 60000 | 6 |
| 8 | Hari | Sales | NULL | 6 |
SELECT e.name, m.name FROM emp e JOIN emp m ON e.mgr = m.id WHERE e.dept <> m.dept ORDER BY e.id;
- A.
Chetan | Anil
- B.
Esha | Chetan, Gita | Farhan
- C.
Sign up free to see the answer and a step-by-step explanation.