Skip to main content
SQL • LESSON 129

Group by Month

How can we calculate order volumes grouped by calendar month?

Advanced3 Minutes1420 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