Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
NULLIF and safe division. NULLIF(x, 0) returns NULL when x is 0 and x otherwise. Dividing by NULLIF(denominator, 0) gives NULL instead of an error or infinity when there is nothing to divide by. ROUND(value, 2) then rounds the result, and ROUND of NULL stays NULL.
select product_name, round(list_price / nullif(unit_cost, 0), 2) as markup from products
The returns team tracks a daily refund ratio for December: refunded orders divided by completed orders placed that day. On a day with no completed orders the ratio has no meaning and should stay empty.
Starting from the query given, return order_date and refund_ratio: refunded ÷ completed for each December 2025 day, rounded to 2 decimals, and NULL on days with no completed orders.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe