Question DB-SQL-0062
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 dept, COUNT(*), COUNT(salary), AVG(salary) FROM emp GROUP BY dept HAVING COUNT(*) > COUNT(salary);
- A.
Sales | 3 | 2 | 38333.33
- B.
No rows
- C.
Sign up free to see the answer and a step-by-step explanation.