Skip to main content
SQL โ€ข LESSON 129

Group by Month

How can we calculate order volumes grouped by calendar month?

Advancedโฑ 3 Minutesโญ 1420 XP
๐Ÿค” THE QUESTION

How can we calculate order volumes grouped by calendar month?

๐Ÿ’ก WHAT IS IT?

Grouping by extracted month components aggregates transaction counts into monthly cohorts.

๐ŸŽฏ WHAT IS IT USED FOR?

Monthly sales volume reporting, seasonality demand charts, order frequency trends.

๐Ÿ’ป EXAMPLE
SELECT
EXTRACT(MONTH FROM order_date) AS order_month,
COUNT(*) AS order_count
FROM orders
GROUP BY EXTRACT(MONTH FROM order_date);

๐ŸŽฏ Mission Objectives

Practice typing production-grade SQL code for Group by Month.

  • โœ“ GROUP BY EXTRACT
  • โœ“ Monthly aggregation
  • โœ“ Transaction volume by month
  • โœ“ Time-series grouping