Revenue growth: 'Groceries', no cancellations, Mar–Sep 2025
Instructions
A month's revenue is the sum of quantity * order_items.price over the items of orders of the category 'Groceries' (category_id = 8) with a status other than 'cancelled' created on or after March 1, 2025 and strictly before October 1, 2025; months without sales are not output. Find the months whose revenue is strictly greater than the revenue of the immediately preceding calendar month (the previous month must also be in this period and have sales, so the first month of the period is not in the result). Output month (the first day of the month), revenue, prev_revenue and growth_pct, the growth as a percentage of the previous month's revenue, rounded to 2 decimal places. Row order does not matter.
Hints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Table relationships
- N:1Many-to-one
order_items.→order_id orders.id - N:1Many-to-one
order_items.→product_id products.id - N:1Many-to-one
orders.→customer_id customers.id - N:1Many-to-one
products.→category_id categories.id
Table data
Select a table in the diagram or list to view its rows.