Finance Data Analyst Path · Mission 6 of 30Easy

Vendor duplicates audit

TRIM and GROUP BY HAVING to detect duplicate values

Back to Finance Data Analyst

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 & columns available

dim_vendorsdim5 columns
ColumnTypeKey
vendor_idINTPK
vendor_nameTEXT
categoryTEXT
countryTEXT
onboarded_dateTEXT

Hints (3)

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

Hint 1

Duplicates here aren't exact — 'Acme' and 'acme ' are the same vendor to Mei, different rows to the database. Normalize the name before you count, and only keep groups that collapse to more than one row.

Hint 2

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

Hint 3

After TRIM + LOWER + GROUP BY, any group with COUNT > 1 is a suspect. The result set is short — that's expected for a well-maintained vendor list.