Revision
Comparisons with NULL
Functions with NULL
COALESCE to the rescue
NULLIF
21. NULLIF – practice 1
Revision and practice

Instruction

Good. Let's do another exercise to practice the use of NULLIF.

Exercise

Show the name of each product and the column ratio calculated in the following way: the price of each product in relation to its shipping_cost in percent (e.g. 31.21), rounded to an integer value.

If the shipping_cost is 0.00, show NULL instead.

Stuck? Here's a hint!

Use the function round(x) to get the rounded value. There is no need to append the percent sign.

Console

Code editor

Result

TableConsole