Finance Path · Mission 6 of 25Easy

Vendor duplicates audit

TRIM and GROUP BY HAVING to detect duplicate values

Back to Finance

The Brief

Jordan ReyesSenior Auditoraudit-review

Running vendor master dedup. Find vendor names that appear more than once after trimming whitespace and lowercasing. Show `normalized_name` and `dup_count`. I suspect at least one trailing-space duplicate is hiding in there.

You'll practice

GROUP BY HAVINGLOWERTRIM

Tables available

dim_vendors

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

`SELECT LOWER(TRIM(vendor_name)) AS normalized_name, COUNT(*) AS dup_count FROM dim_vendors`.

Hint 2

Group by the normalized name, then `HAVING COUNT(*) > 1`.

Hint 3

Exactly one vendor has a trailing-space twin.