Marketing Analytics Path · Mission 17 of 25Hard

Clean up the traffic sources

Use LOWER and TRIM to normalize dirty data and aggregate

Back to Marketing Analytics

The Brief

Priya PatelAnalytics Leadmarketing-analytics

Our session source data is messy — 'google' and 'Google' are showing up as separate rows in dashboards. Can you give me a clean breakdown? Normalize the source column (lowercase + trim), then show each clean source and total session count. Order by count descending.

You'll practice

LOWERTRIMNormalization

Tables available

fact_sessions

Hints (3)

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

Hint 1

The `source` column in `fact_sessions` has mixed casing ('google' vs 'Google'). Use `LOWER(TRIM(source))` to normalize

Hint 2

Alias the cleaned value: `LOWER(TRIM(source)) AS clean_source` and use it in both SELECT and GROUP BY

Hint 3

Count sessions per clean source with `COUNT(*) AS session_count` and ORDER BY session_count DESC