Question: The first developer then writes another query, Q3, to find the (unique) gld and names of guests who have participated in a least one

The first developer then writes another query, Q3, to find the (unique) gld and names of guests who have participated in a least one stay: SELECT Gld, Name FROM Guest g WHERE COUNT(SELECT * FROM Stay s WHERE s.Gld-g.Gld) >0 The second developer again complains, and says that it should be rewritten as Q4: Q4: SELECT DISTINCT GId, Name FROM Guest NATURAL JOIN Stay Discuss under what conditions Q4 might be more efficient than Q3, as well as under what conditions Q3 might be more efficient than Q4.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
