• Jeff Moden (4/1/2013)


    LutzM (3/11/2012)


    I like the FizzBuzz puzzle.

    I use it to identify if an applicant

    - prefers using a set or loop based method where both methods are possible

    - knows enough T-SQL to generate a numbers list from scratch (or if the person knows a method to generate such a list based on a system table)

    - understand how the CASE fuction works

    - knows how deal with error messages (usually an applicant would simply add "ELSE number" leading to a conversion error)

    This simple test is also a good start to talk about some rather basic SQL internals: (Why does SQL Server try to convert "fizz" to a numeric value?)

    The test to find duplicate rows is a good test for solving a common task.

    Unless it's a very smart Junior, I wouldn't expect them to even know what a numbers list is never mind be able to generate one. Sure, the code is simple but I've worked with many supposedly Sr. Level Developers and DBAs that have never heard of things when it comes to numbering things. Shoot, even ROW_NUMBER has been out for over 8 years and I'm still finding Seniors that know nothing about it.

    That wouldn't be a problem with some of the students coming from one of the colleges here in town if they would higher me to teach a MS SQL Server class. Using a Tally or Numbers table has become an important part of what I do on a regular basis almost. Using ROW_NUMBER() as well.