Direction: Choose the correct option
Q1.
What is a subquery?
Direction: Choose the correct option
Q2.
SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);What type of subquery is this?Direction: Choose the correct option
Q3.
SELECT name, salary, (SELECT AVG(salary) FROM employees) AS avg_salary FROM employees;Where is the subquery placed?Direction: Choose the correct option
Q4.
SELECT * FROM employees WHERE dept_id IN (SELECT id FROM departments WHERE location = 'New York');What operator is used with this subquery?Direction: Choose the correct option
Q5.
SELECT * FROM customers c WHERE EXISTS (SELECT 1 FROM orders o WHERE o.customer_id = c.id);What does EXISTS check?