Business Intelligence Path · Mission 10 of 25Easy

Tag every sale by size

Combine CASE WHEN with multi-table JOINs and multiple aggregation levels

Back to Business Intelligence

The Brief

Rachel TorresCFOslack-dm

For the revenue review, I need every sale classified by deal size: 'Small' if revenue < 100, 'Medium' if 100-500, 'Large' if 500-2000, and 'Enterprise' if over 2000. Show the deal size bucket, number of transactions, total revenue, and average revenue per deal. Sort by total revenue descending.

You'll practice

CASE WHENMulti-table JOIN

Tables available

fact_sales

Hints (3)

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

Hint 1

Use CASE WHEN on the revenue column to create deal size buckets

Hint 2

GROUP BY the CASE WHEN expression and compute COUNT(*), SUM(revenue), AVG(revenue)

Hint 3

Use ROUND on the average for cleaner output