Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

BETWEEN Expand / Collapse
Author
Message
Posted Wednesday, June 4, 2008 8:07 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 11:32 PM
Points: 7,118, Visits: 14,996
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?
Post #511894
Posted Wednesday, June 4, 2008 8:23 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, January 8, 2014 2:49 PM
Points: 1,279, Visits: 2,203
Good question. The detail-oriented person earns 1 point as reward. :)
Post #511899
Posted Wednesday, June 4, 2008 11:58 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 8:40 AM
Points: 1,568, Visits: 666
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



Post #511932
Posted Thursday, June 5, 2008 1:38 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Monday, July 7, 2014 7:25 AM
Points: 798, Visits: 995
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... :)
Post #511952
Posted Thursday, June 5, 2008 2:49 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 4:58 AM
Points: 2,951, Visits: 5,231
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...



Post #511963
Posted Thursday, June 5, 2008 3:06 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, July 15, 2014 4:53 AM
Points: 2,366, Visits: 1,844
Hi

question is rather poorly worded. I thought the question was whether running the statements repeatedly would produce different results.


"Keep Trying"
Post #511971
Posted Thursday, June 5, 2008 3:27 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 11:11 AM
Points: 1,396, Visits: 554
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
Post #511979
Posted Thursday, June 5, 2008 6:15 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 3:51 AM
Points: 928, Visits: 1,112
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
Post #512042
Posted Thursday, June 5, 2008 6:16 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, July 14, 2014 11:19 AM
Points: 115, Visits: 129
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.
Post #512043
Posted Thursday, June 5, 2008 6:26 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, October 23, 2013 7:57 AM
Points: 1,110, Visits: 1,148
The title of the question was 'BETWEEN' therefore it was obviously going to test your between knowledge. Stop complaining and get back to work.
Post #512051
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse