Use TRIM to fix trailing spaces and re-aggregate clean data
Marcus showed me the product category breakdown and I'm seeing 'electronics' twice in the report. That can't be right. Can you figure out what's going on and give me a clean breakdown? I need the trimmed category, purchase count, and total revenue — sorted by revenue, no refunds.
Each hint you reveal reduces the XP you can earn. Try the query first.
'electronics' appears twice because one has a trailing space. Use `TRIM(product_category)` to strip it
Use the trimmed value in both SELECT and GROUP BY: `TRIM(product_category) AS category ... GROUP BY TRIM(product_category)`
Filter `WHERE amount > 0` for purchases only, and use `ROUND(SUM(amount)::numeric, 2) AS total_revenue`. You should get 8 rows, not 9