Direction: Choose the correct option
Q1.
What is a correlated subquery?
Direction: Choose the correct option
Q2.
SELECT * FROM employees e1 WHERE salary > (SELECT AVG(salary) FROM employees e2 WHERE e2.dept_id = e1.dept_id);How does this correlate?Direction: Choose the correct option
Q3.
SELECT * FROM departments d WHERE EXISTS (SELECT 1 FROM employees e WHERE e.dept_id = d.id);What does this find?Direction: Choose the correct option
Q4.
SELECT * FROM products p1 WHERE price > (SELECT AVG(price) FROM products p2 WHERE p2.category = p1.category);What does this query do?Direction: Choose the correct option
Q5.
How does performance of correlated subqueries compare?
