Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
GROUP BY two columns. GROUP BY can take several columns. Each distinct combination of their values becomes one group, so GROUP BY a, b gives one row per (a, b) pair. Every column in SELECT that isn't inside an aggregate must be in the GROUP BY list.
select region_id, segment, count(*) as customers from customers group by region_id, segment
The operations lead wants to see, for each sales channel, how many orders were completed, refunded or cancelled.
Return channel, status and orders (the number of orders), with one row for every channel and status pair that exists.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe