Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
Data-quality check: duplicates. A duplicate check groups rows by the key that should be unique and keeps the groups with more than one row: GROUP BY key HAVING COUNT(*) > 1. In a raw export, the copies rarely match letter for letter, so clean the key first (trim, one case, one format) and group on the cleaned values.
select customer_id, order_date, count(*) as orders from orders group by customer_id, order_date having count(*) > 1
Before the CRM export is loaded into the new email tool, sales ops wants every contact that appears more than once, even when the copies are formatted differently.
Clean customer_ref to a number (trim, upper case, remove 'C-', cast to integer) and contact_name to trimmed lower case. Return customer_id (the cleaned ref), contact_name (cleaned) and copies (number of rows) for every pair that appears more than once.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe