SQL Subqueries
11.What will the following query return? - Assume departments table has 2 departments located in 'Delhi', with department_ids 2 and 4. And employees table has:
| name | department\_id |
| ----- | -------------- |
| Rahul | 2 |
| Meena | 3 |
| Arjun | 4 |
| Rekha | 5 |
SELECT name
FROM employees
WHERE department_id IN (
SELECT department_id
FROM departments
WHERE location = 'Delhi'
);
-
A. Rahul and Arjun
-
B. Meena and Rekha
-
C. All employees
-
D. Only Arjun
Rahul and Arjun
Rahul and Arjun