Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. This is also a part of a basic series on git and how to use it.

There’s been a programmer test that was used for awhile to see if a simple program could be constructed. It’s FizzBuzz, after a kids game, and designed to see if someone knows some logical program construction.

The test is to produce a list from 1 to 100 and for multiples of 3, write “Fizz”, multiples of 5 produce “Buzz” and multiples of both produce “FizzBuzz”. This means you get:

2017-07-06 10_18_44-SQLQuery1.sql - (local)_SQL2016.WideWorldImporters-RR (PLATO_Steve (64))_ - Micr

It’s a simple test, but I wonder how long it would take you to write it in T-SQL? It took me about 2 minutes.

Give yourself a little quiz today. For a challenge, also produce this in PoSh or some other language. I took about 5 minutes in PoSh, mostly because I had to look up some syntax.

In case you think this doesn’t matter, I agree with Jeff Atwood. I’d like to look at someone’s code before I interview them for development. They should have some public code, maybe something they recommend.


If you’re looking for a blog topic, show us you can write this code.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , . Bookmark the permalink.

3 Responses to FizzBuzz–#SQLNewBlogger

  1. Kurt W. Zimmerman says:

    I don’t know if it took me 2 minutes. I will say this, it ran the first time with the expected results. After reading the article it does amaze me that there are developers that would struggle over such a simple assignment.


    • way0utwest says:

      I agree. Seems simple to me. we could argue slightly about the result set that should be displayed, but just getting the results should be easy.


  2. Pingback: FizzBuzz in SQL | SqlSandwiches

Comments are closed.