CHOOSE - 1

  • Comments posted to this topic are about the item CHOOSE - 1

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • I'm guessing that since Fall is returning as least hires, that you need to have adventureworks to be able to answer this question correctly.

  • Thanks Ron for another one on SS 2012.

    Though I understood the CHOOSE function well, but have to query Employee table to get the answer correctly.

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • Lokesh Vij (1/27/2013)


    Thanks Ron for another one on SS 2012.

    Though I understood the CHOOSE function well, but have to query Employee table to get the answer correctly.

    Ya , without Employee table it's all a guess work ..

    Thanks for the question , It reminded me how Choose works ...

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • demonfox (1/27/2013)


    Lokesh Vij (1/27/2013)


    Thanks Ron for another one on SS 2012.

    Though I understood the CHOOSE function well, but have to query Employee table to get the answer correctly.

    Ya , without Employee table it's all a guess work ..

    Thanks for the question , It reminded me how Choose works ...

    +1

    [font="Verdana"]Regards,
    Rals
    [/font].
  • 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.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Among all the choices of the features, you chose CHOOSE, and chosen one you chose was the only choice you had, and in that we have to choose 2 among 8 choices, and two choices I chose were correct.

    Nicely framed question using the sample db. πŸ™‚

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • This was removed by the editor as SPAM

  • Don't have AdventureWorks either... πŸ™

    Best Regards,

    Chris BΓΌttner

  • 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.

  • 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 know how CHOOSE works, but I do not want to know what the default data are for the table Employ!

    Let's go!

  • 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)[/url]

  • 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 [/url]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

  • 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/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

Viewing 15 posts - 1 through 15 (of 56 total)

You must be logged in to reply to this topic. Login to reply