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


CHOOSE - 1


CHOOSE - 1

Author
Message
Carlo Romagnano
Carlo Romagnano
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4903 Visits: 3326
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
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4903 Visits: 3326
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
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: 2440 Visits: 6494
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 (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5294 Visits: 4688
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 question

There 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
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10979 Visits: 11985
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! (946 reputation)SSC Eights! (946 reputation)SSC Eights! (946 reputation)SSC Eights! (946 reputation)SSC Eights! (946 reputation)SSC Eights! (946 reputation)SSC Eights! (946 reputation)SSC Eights! (946 reputation)

Group: General Forum Members
Points: 946 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
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2717 Visits: 2255
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.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

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

Group: General Forum Members
Points: 1303 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.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2092 Visits: 774
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