Question: Which query would be more efficient? 1 . SELECT * FROM customer WHERE city IN ( SELECT city FROM employee WHERE reports _ to =
Which query would be more efficient?
SELECT
FROM customer
WHERE city IN
SELECT city
FROM employee
WHERE reportsto ;
SELECT customer.
FROM customer
INNER JOIN employee
ON customer.city employee.city
WHERE reportsto ;
Query # would be more efficient as it is based on primary and foreign keys.
Both would be the same as both use the same indices for the join and filter.
Query # would be more efficient as it is based on primary and foreign keys.
Query # would be more efficient as it is not using indexed columns.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
