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