The Blunder

  • + 6 comments

    There is a bug in your SQL Server code evaluator. SELECT CEILING(AVG(SALARY - CAST(REPLACE(CAST(SALARY AS VARCHAR(10)), '0', '') AS float))) FROM EMPLOYEES

    Your code evaluator returns 2253.0 rather than 2253, so it is marked as an incorrect answer.

    However, according to Microsoft, https://msdn.microsoft.com/en-us/library/ms189818.aspx, CEILING returns the smallest integer greater than numeric expression.

    Test the CEILING function in SSMS and you receive an integer every time.