E-commerce & Retail Analytics Path · Mission 7 of 30Easy

Orders by month

Truncate a date column to month-grain with `substr(date, 1, 7)` (SQLite-portable) and group by it. The fundamental time-series rollup that drives every monthly bookings dashboard.

The Brief

Devon ParkSenior Analyst, Marketingecom-ops

Monthly cadence dashboard. Truncate `created_date` to year-month (YYYY-MM) and count orders per month. Use `ecom_orders`. One row per month, ordered chronologically (ascending). I want to see the holiday spike in Dec and the April push we just did.

You'll practice

DATE_TRUNCGROUP BY

Tables & columns available

ecom_ordersfact13 columns
ColumnTypeKey
order_idINTPK
customer_idINTFK → ecom_customers
order_numberTEXT
financial_statusTEXT
fulfillment_statusTEXT
total_priceREAL
subtotalREAL
taxREAL
shippingREAL
discount_totalREAL
channelTEXT
created_dateTEXT
processed_dateTEXT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

SQLite-portable month truncation: `substr(created_date, 1, 7)` returns 'YYYY-MM' from a 'YYYY-MM-DD ...' string.

Hint 2

GROUP BY the truncated month column, COUNT(*) for the orders. ORDER BY month ASC for chronological output.

Hint 3

You should see 15 monthly buckets. April 2025 is the biggest at 37 orders (the demo seed concentrates the recent push).