Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
Rates and shares. A rate is a part divided by its whole: matching rows ÷ all rows, times 100 for a percentage. Keep both counts in the same group so they describe the same thing, and divide before you ROUND. Multiplying by 100.0 keeps the maths in decimals.
select segment, round(100.0 * count(*) filter (where region_id = 4) / count(*), 2) as west_pct from customers group by segment
Leadership wants to compare channels by how often orders fail: what share of each channel's orders were refunded, and what share were cancelled.
Return channel, refund_rate_pct and cancel_rate_pct: refunded orders and cancelled orders as a percentage of all of that channel's orders, each rounded to 2 decimals.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe