Teradata interview question

Write the code for and explain the solution behind fizzbuzz