IntermediateRetailSQL+20 XP

Revenue by category with a sales threshold

Scenario

You are a data analyst. A grocery chain is deciding which categories get extra shelf space next quarter. Merchandising wants revenue per category, but only categories that actually move.

Question

Show category and total revenue (quantity * unit_price) for categories with revenue above 5000, highest first.

Intermediate · Record Counting & Average Calculations — question 11 of 30

Finish all 30 to earn a certificate

1. Choose your dataset

Pick an industry and a size. Your code and results change to match.

sql editor
Type your code here ↓
✍️ Tap here to type

Dataset & schema

store_sales

The tiny starter data. Bigger data scrolls.

Fields

sale_idcategoryquantityunit_pricestore
1Beverages12024.5Sandton
2Bakery30012Sandton
3Beverages21024.5Durban
4Household4089Durban
5Bakery15012Cape Town
attempts: 0
▶ Output terminal
$ Press “Check my answer” — results appear here.

Your next steps

Each item turns green when your answer includes it.

4 left
  • Sums revenue
  • Groups by category
  • Filters aggregate with HAVING
  • Orders descending