SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


CHOOSE - 1


CHOOSE - 1

Author
Message
Carlo Romagnano
Carlo Romagnano
SSCertifiable
SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)

Group: General Forum Members
Points: 7357 Visits: 3395
raulggonzalez (1/28/2013)
I don't see what this QotD is trying to test... It's not about how CHOOSE works but what data you have in a table that is not represented on the question itself...

how can anybody come up with the right answer without executing the query (against the right db)??

obviously I didn't, I just followed the logic that of there are more months for winter and less for spring, those should've been the correct answers.

didn't like it.

+1

w00t

I run on tuttopodismo
Carlo Romagnano
Carlo Romagnano
SSCertifiable
SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)

Group: General Forum Members
Points: 7357 Visits: 3395
I know how CHOOSE works, but I do not want to know what the default data are for the table Employ!
Let's go!

I run on tuttopodismo
Jan Van der Eecken
Jan Van der Eecken
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3191 Visits: 6497
Koen Verbeeck (1/28/2013)
Apparently, there are 4 winter months? :-)
Anyway, I don't have AdventureWorks 2012 installed on this machine, so I had to guess. Quite a pity, because the idea of the question was good.


+1, exactly my sentiment. Shame, because it would have been a really good question.

--------------------------------------------------------------------------
A little knowledge is a dangerous thing (Alexander Pope)

In order for us to help you as efficiently as possible, please read this before posting (courtesy of Jeff Moden)
Stuart Davies
Stuart Davies
SSCertifiable
SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)

Group: General Forum Members
Points: 7211 Visits: 4814
Jan Van der Eecken (1/28/2013)
Koen Verbeeck (1/28/2013)
Apparently, there are 4 winter months? :-)
Anyway, I don't have AdventureWorks 2012 installed on this machine, so I had to guess. Quite a pity, because the idea of the question was good.


+1, exactly my sentiment. Shame, because it would have been a really good question.

Agree - good otherwise Ron

-------------------------------Posting Data Etiquette - Jeff Moden Smart way to ask a questionThere are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx
Hugo Kornelis
Hugo Kornelis
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18255 Visits: 12426
Tough I applaud the effort to create questions on new SQL2012 functionality, I really see nothing positive about this question.

First, without AdventureWorks2012 it's impossible to answer the question. True, everyone can download that sample database - but if you doon't have SQL Server 2012, will it even install? I never tried, but I doubt it. And if you use an older version of AdventureWorks, you can't be sure that the data is identical.

Second, even with an AdventureWorks2012 database, it is still almost impossible to answer without running the code. There are 290 rows in the Employee table. Do you really expect me to go over them by hand and count the months from all the hiredate values?
And if I just run the code, it kind of defeats the purpose of learning about the Choose function.

Third, I don't understand the uneven distribution of months in the CHOOSE function. I know Ron long enough to trust that he didn't deliberately make this into a trick question, but it has turned out that way - with four months being assigned to winter and only two to spring, I am not surprised to see a high percentage of people choosing "most in winter / least in spring". If I had not had access to AdventureWorks (and hence been forced to guess), I would have picked that combination too, based on the season list in the CHOOSE function.

This question would have been so much better if it had been based on a much lower number of rows that were included in the question (so that you could just count the results by hand). Lost opportunity - too bad!


Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
dhober
dhober
SSC Eights!
SSC Eights! (968 reputation)SSC Eights! (968 reputation)SSC Eights! (968 reputation)SSC Eights! (968 reputation)SSC Eights! (968 reputation)SSC Eights! (968 reputation)SSC Eights! (968 reputation)SSC Eights! (968 reputation)

Group: General Forum Members
Points: 968 Visits: 328
As someone who definitely tries to run through the question in my mind, and not against an actual database, I also agree that it would have been helpful if the question included the table data as well.
Thomas Abraham
Thomas Abraham
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3767 Visits: 2256
Koen Verbeeck (1/28/2013)
Apparently, there are 4 winter months? :-)
Anyway, I don't have AdventureWorks 2012 installed on this machine, so I had to guess. Quite a pity, because the idea of the question was good.


However, if you try to answer the question within ten minutes of getting out of bed, you don't even notice that there are four months for Winter - at least I didn't. I wrongly assumed three for each, as my browser window was small and the end of the code line went off the page.

Then I just assumed an even distribution of employee hire dates. Understanding how CHOOSE works, I then correctly answered a question that wasn't asked.Hehe

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Rich Weissler
Rich Weissler
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2179 Visits: 954
I kept looking for a trick... something that wouldn't depend on the data itself that wasn't presented.
okbangas
okbangas
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2513 Visits: 1387
Ridiculous question as you have to know the content of a table in AdventureWorks 2012 to get the answer correct.



Ole Kristian Velstadbråten Bangås - Virinco - Facebook - Twitter

Concatenating Row Values in Transact-SQL
palotaiarpad
palotaiarpad
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2409 Visits: 802
Hugo Kornelis (1/28/2013)
Tough I applaud the effort to create questions on new SQL2012 functionality, I really see nothing positive about this question.
...
This question would have been so much better if it had been based on a much lower number of rows that were included in the question (so that you could just count the results by hand). Lost opportunity - too bad!

+1
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search