Revision
So you think you can count
12. Getting rid of division by 0
Round and other functions
Revision and practice

Instruction

Oops! As you can see, the error occurs even if there is a single row with a 0 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 old good WHERE clause to filter out those rows which contain a 0:

...
WHERE column_name != 0;

You'll get to know other methods of dealing with division by zero in further parts of 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.

Console

Code editor

Result

TableConsole