|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 6:49 PM
Points: 6,998,
Visits: 13,946
|
|
Comments posted to this topic are about the item BETWEEN
---------------------------------------------------------------------------------- Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 7:19 AM
Points: 1,279,
Visits: 2,191
|
|
| Good question. The detail-oriented person earns 1 point as reward. :)
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 7:30 AM
Points: 1,566,
Visits: 600
|
|
| Badly worded question - Would statements #1 and #2 consistently return the same result set? How do we define "Same Result" Same result as the other statement? Same result across multiple executions of each statement?
Obviously statement #2 will always return 0 - 5 is greater than 3. DUH. But if you rerun statement #1 (without rerunning the CREATE / INSERT statements), it will always return the same result; just as statement #2 will always return 0.
Sorry, didn't like that question at all. This reminds me of the old style MS certification questions - the answer is open to interpretation of the question.
At least I get a point for this post ...:P
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 4:27 AM
Points: 798,
Visits: 983
|
|
my understanding was that subsequent runs of statement #1 and statement #2 would return the same result (over time)- which does, if the table is not cleared and the insert rerun.... not that the two results whould be equal to each other (i say it was quite obvious that the 2nd would return 0 ) oh well... :)
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 10:49 AM
Points: 2,462,
Visits: 3,573
|
|
I don't normally criticise the questions as:
a. This site is free b. You don't win anything c. You nearly always learn something even when the question is ambiguous!
But this one is really ambiguous for me as depending on how you read the question all three answers are true:
1. Create the table insert the data once. Would statement one always return the same answer - Yes, would statement two always return the same answer - Yes
2. Same scenario, but would statement one AND statement two return the same answer - No (Which is the point of the question as beautifully explained!) OK maybe it's too early in the morning and my brain wasn't quite with it as it really couldn't be option 1, but…
3. You run the whole script every time (it was a temp table after all!) - Well as the data could change each time - Undetermined!
So I had a one in three chance (seeing as I nearly always pick the wrong one in a fifty/fifty - I had no chance with a 1 in 3!) of picking the right answer, which of course I didn't!
So c. rules again, as at least I had to think about this one! And it reminded me of – if you are using parameter values in the where, i.e. BETWEEN @Param1 AND @param2. Check first if the @Param1 is less than @Param2 (if not swap them round!)
Rodders...
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 5:02 AM
Points: 2,365,
Visits: 1,825
|
|
Hi
question is rather poorly worded. I thought the question was whether running the statements repeatedly would produce different results.
"Keep Trying"
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, April 04, 2013 4:54 AM
Points: 1,383,
Visits: 520
|
|
I read the question as if multiple executions of the select statements would return the same result, so I unfortunately selected the incorrect answer.
I think that it would be better worded as:
"Would statements #1 and #2 consistently return identical result sets?"
What does everyone else think?
Regards,
Phil
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, March 06, 2013 12:56 AM
Points: 898,
Visits: 1,045
|
|
statement 2 will always result the same result set: nothing To my opinion, the answer is YES
The explanation was about a misused BETWEEN ... what a @#$!%!#
Wilfred The best things in life are the simple things
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 4:12 PM
Points: 115,
Visits: 110
|
|
I have to say that I did not like this question either. If you only run the create and insert once you will consistently get the same results in each of the queries seperately. Re-running them multiple times as in a stored proc, would obviously produce results that would not be consistent with the exception of query 2, but not both.
Sorry, trick questions open to interpretation are bogus. What is my knowledge, I guess that is open to interpretation too.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 11:44 AM
Points: 1,110,
Visits: 1,145
|
|
| The title of the question was 'BETWEEN' therefore it was obviously going to test your between knowledge. Stop complaining and get back to work.
|
|
|
|