Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
string_agg. string_agg(text, separator) is an aggregate that joins the values of a group into one text, like SUM for words. Add ORDER BY inside the brackets to fix the order: string_agg(name, ', ' ORDER BY id). Rows where the value is NULL are skipped.
select category, string_agg(product_name, ', ' order by list_price desc) as products from products group by category
Data ops is merging duplicate CRM records and wants one line per customer ref that has more than one contact, listing the contact names together so a person can check them.
For every customer_ref (trimmed, in capitals) with more than one contact, return ref and contacts: the cleaned contact names (trimmed, double spaces made single, lower case) joined with ', ' in contact_id order.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe