Business Intelligence Path · Mission 3 of 31Starter

Product mix is shifting

Normalize inconsistent category casing and calculate each category's share of total revenue

Back to Business Intelligence

The Brief

Priya NairHead of Productproduct-analytics

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.

You'll practice

Category normalizationSubqueriesPercentages

Tables & columns available

fact_salesfact8 columns
ColumnTypeKey
sale_idINTPK
employee_idINTFK → dim_employees
product_idINTFK → dim_products
region_idINTFK → dim_regions
sale_dateTEXT
quantityINT
revenueREAL
discountREAL
dim_productsdim5 columns
ColumnTypeKey
product_idINTPK
product_nameTEXT
categoryTEXT
unit_priceREAL
launch_dateTEXT

Hints (3)

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

Hint 1

Revenue lives in the fact table but categories are in the product dimension — you'll need to connect them. Before aggregating, check whether the category column has a data quality issue that could split what should be one group into two.

Hint 2

Use LOWER(category) to normalize 'Electronics' and 'electronics' into one bucket

Hint 3

For the percentage, divide each category's revenue by the total: SUM(revenue) / (SELECT SUM(revenue) FROM fact_sales)