Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
Joining text with ||. a || b glues two values into one text: 'C-' || 1001 gives 'C-1001'. It is handy for building a key in the same format as another table, but the result must match exactly, spaces and capital letters included, or the join finds nothing.
select region || ' (' || manager || ')' as region_label from regionsMarketing asked the AI assistant how many CRM contacts belong to each customer segment. Its totals add up to far fewer contacts than the import holds, although almost every ref points at a real customer.
AI assistant: “I built each customer's ref as 'C-' plus the customer_id, trimmed the CRM refs, joined them and counted contacts per segment.”
Run the AI query, then fix it so it returns segment and contacts: the number of crm_contacts rows whose customer_ref (trimmed, any case) matches a customer, one row per segment.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe