Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
So you think you can count?
Rounding functions and more
Review and practice


Wait… what? We got a 0? After all these years of being taught it's 0.25?

Has someone deceived us? Not really.

What happened here is called integer division. Integer division occurs when both the dividend and the divisor are integers. Since they are integers, SQL Server wants to return an integer result to match the operand types. In other words, it brutally cuts off the decimal part, which is .25 in our case. The zero (0) is the only thing left.

So, how can we make sure that the result includes the decimal part? One way is to change the type of one of the values to a decimal (e.g., 1 / 4.0 instead of 1 / 4). In this course, we will always change the type of the counter.


Run another example query to see what happens when you use a decimal.