Wait, is this a real exam question or a deleted scene from The Office? I feel like Dwight Schrute would nail this one, but only after a lengthy lecture on the finer points of SQL optimization.
I bet the person who wrote this question just wanted to see if we could spot the CROSS JOIN trap. Nice try, but I'm on to you! D) 12 is the right answer.
Hmm, the CROSS JOIN looks a bit suspicious to me. I wonder if there's a more efficient way to get the same result without generating a Cartesian product first. But I guess the answer is still D) 12.
This seems straightforward. The CROSS JOIN will create a result set with all possible combinations of employees and departments, and the WHERE clause will restrict it to only managers in departments 10 and 20. The correct answer is D) 12.
The CROSS JOIN between the emp and dept tables will generate a Cartesian product, and the WHERE clause will filter the rows where the job is 'MANAGER' and the department number is 10 or 20. The number of rows in the output should be 12.
Catalina
1 months agoDenae
7 days agoLea
14 days agoCarri
2 months agoLucille
3 days agoFarrah
4 days agoCorazon
9 days agoRenay
2 months agoDannette
1 months agoVallie
1 months agoLauna
2 months agoQueen
2 months agoYolande
2 months agoLuis
2 months agoAbel
2 months agoMakeda
2 months agoWilbert
2 months agoKimbery
2 months agoLaila
2 months agoCassandra
3 months agoLuis
3 months ago