Normalize inconsistent category casing and calculate each category's share of total revenue
Can you build me a product category revenue breakdown? I want to see each category, its total revenue, and what percentage of overall revenue it represents. I've heard there might be a casing issue in the category data that's splitting one category into two rows — can you normalize it so we're not double-counting? Sort by total revenue descending.
Each hint you reveal reduces the XP you can earn. Try the query first.
JOIN fact_sales to dim_products on product_id to get category data alongside revenue
Use LOWER(category) to normalize 'Electronics' and 'electronics' into one bucket
For the percentage, divide each category's revenue by the total: SUM(revenue) / (SELECT SUM(revenue) FROM fact_sales)