Spotting duplicate customers
Some customers registered twice with their name typed differently: 'Acme Ltd' and 'ACME LTD ', say. Group by a tidied version of the name to find them:
SELECT LOWER(TRIM(name)) AS clean_name, COUNT(*) AS records
FROM customers
GROUP BY LOWER(TRIM(name))
HAVING COUNT(*) > 1The more you tidy, the more you catch. 'Limited' and 'Ltd', or '&' and 'and', are the same company:
REPLACE them to one spelling before grouping.
Two consumers really can share a name, so treat this as a list to check, not proof. Compare their emails or postcodes before merging anything.