Carlo Romagnano wrote: Jason- wrote:
*** sorry for the spoilers; but my comment didn't make sense to me without them ***
I debated with myself between "Zero re ...
No, "Zero records" is not correct as answer. You should consider any possible scenario. It's the same to guess the order of rows of the following query: "SELECT 1 UNION SELECT 2", you can run it 1000 times it returns 1,2; but without the ORDER BY CLAUSE the result is unpredictable (it's a time bomb).
;TLDR I guess I'm not suggesting that "Zero records" is correct (it is the word I used, incorrectly... irony :-), just reasonable to assume it's correct given the details that were available. Important lesson depicted by this QoD and also reinforcing, slowing down and paying attention to detail typically pays off; good job.
Without more detail in the question that specifies scenarios, Zero records is, or more accurately is likely to be, a valid answer. I stated there are what if's that would invalidate Zero records but those what if's were not specified in the question so it is a reasonable answer... it is still the wrong answer in some scenarios, but it is reasonable. [Just to be clear, "Returns distinct rows from the left input query that aren't output by the right input query" is always correct while "Zero records" is only sometimes correct... I get that]
We all know in real life that we don't get all the info up front and some of the details we do get can be subtly misleading, like a QoD labeled as being about EXCEPT when it's really about EXCEPT and optimistic locking. That's the reason I think this is a good question; it is depicting a real life scenario where we don't start with all the details or the same understandings and discussions reveal more things that get us from one conclusion (valid and reasonable) to another (factual and consistently correct).
So it's still my opinion that the question could benefit from more detail to avoid any confusion or bad assumptions. No surprise though, that's also my opinion in real life scenarios. When a user reports, "It's broken", or "I'm getting an error when I do x" or whatever, I always try to get more detail to get a better understanding, to uncover the scenarios that are invalidating mine or other developer's assumptions.