Review
So you think you can count?
14. Getting rid of division by zero
Rounding functions and more
Review and practice

Instruction

Oops! As you can see, the error occurs even if there is a single row with a zero value in the denominator.

How can we deal with it? There are a few ways to solve the problem.

For now, you can use the good old WHERE clause to filter out any rows that contain a zero:

WHERE ColumnName != 0;

We'll discuss other methods of dealing with division by zero later in our course.

Exercise

For each character, show its name and try to divide its MP by its Wisdom. Filter out rows with 0 wisdom points. Name the column Ratio.

Stuck? Here's a hint!

Don't forget about CAST() in division.