Adam works as a Database Administrator for Domain.com. The company uses MySQL as its
database. Adam has created a table named Employees in the database. He wants to retrieve the
information of those employees who have at least one person reporting to them. Which of the
following queries will Adam execute to accomplish the task?
A.
SELECT employee_id, last_name, job_id, department_id FROM Employees WHERE
employee_id
EXISTS (SELECT manager_id WHERE manager_id is NULL);
B.
SELECT employee_id, last_name, job_id, department_id FROM Employees HAVING
employee_id
IN (SELECT manager_id FROM Employees WHERE manager_id is NOT NULL);
C.
SELECT employee_id, last_name, job_id, department_id FROM Employees outer WHERE
EXISTS
(SELECT ‘x’ FROM Employees WHERE manager_id = outer.employee_id);
D.
SELECT employee_id, last_name, job_id, department_id FROM Employees WHERE
employee_id IN
(SELECT manager_id WHERE manager_id is NOT NULL);