When you're running queries in SQL, especially averages or fractions, there's a thing to watch out for: You might unexpectedly end up with a result of 0. And it's not because your query is wrong!
In some SQL languages, if you divide two whole numbers and the result is less than 1, SQL rounds it down to 0. This can also happen with the AVG function, where the expected average is a fraction but ends up as 0. The result doesn't have to be 0, it can also be 1,2,3 or 4. The thing is when you average an integer (aka a plain number) in SQL, it will return an integer!
But don't worry, there's a clever little workaround. The trick is to tweak one of your numbers to make it a decimal.
How? Just multiply it by 1.00. This simple step ensures SQL treats the calculation as a decimal operation, giving you the precise fraction you're after.

Let's see this in action with a small practice and you'll see that by yourself! 🎉