Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
COUNT(DISTINCT …). COUNT(*) counts rows. COUNT(DISTINCT column) counts the different values in that column, so a value that shows up many times is counted once. It works with GROUP BY too.
select count(distinct category) as categories from products
Sales wants to know how many different customers buy through each channel. Not how many orders, how many customers.
Return one row per channel with two columns: channel and the number of different customers who placed a completed order through it.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe