DataBeginner 1 to 2 hours

Write Basic Aggregation Queries

GROUP BY, HAVING, and ORDER BY on a sales table.

The Scenario

An online retailer has a `sales` table with columns: `order_id`, `product_category`, `sale_amount`, `sale_date`, and `region`. The marketing team wants three quick answers before their Monday meeting.

The Brief

Write three SQL queries against the sales table. You do not need a live database — write the SQL in code blocks and explain what each query returns.

Deliverables

  • Query 1: Total revenue by product category, sorted highest to lowest
  • Query 2: All regions where total revenue exceeds R500,000, using HAVING
  • Query 3: The top 5 highest-revenue days in the last 90 days

Submission Guidance

Write standard SQL (PostgreSQL or MySQL syntax). Include column aliases for readability.

Submit Your Work

Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.

This appears on your public Badge.

0/20000 charactersMarkdown supported

One per line or comma separated. Up to 5 links.

By submitting, you agree your submission text, name, and evaluation will appear on a public Badge URL.