← SQL Analyst Starter

Lesson 2 of 4

Group without losing rows

Aggregate revenue by a declared grouping key.

Do the work

  1. WHERE applies before GROUP BY.
  2. SUM(amount) totals whole-dollar amounts.
  3. COUNT(*) counts rows, including repeated values.

See the method

Filter paid orders.

Read every demonstration step
  1. Filter paid orders.
  2. Group by region.
  3. Name the aggregate paid_revenue so the report has a clear header.

Practice independently

Take it further

Compare COUNT(*) with COUNT(customer_id) when IDs can be NULL.