Lesson 18 — Mini project: report
Mini project: a monthly report
Combine what you know into one report: GROUP BY month, COUNT the orders, SUM the revenue, and compute the average order value = revenue / orders, rounded. SQLite's substr(text, start, length) cuts text: substr('2026-03-14', 1, 7) is '2026-03'.
SELECT substr(day, 1, 7) AS month, COUNT(*) FROM orders GROUP BY month
Why it matters: "orders, revenue and average basket per month" is the first report almost every online shop builds.
Fill in the avg_order column: revenue divided by the number of orders, rounded to 2 decimals. Expected: 3 months with orders, revenue and average.
Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.
A quick 3-question quiz on this lesson — instant feedback.
Ready for more? Optional paid resources that pick up where this lesson leaves off.
Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.
Project-based SQL Deep Dive courses if you want a structured paid path after the free lessons. Wait for a sale — prices drop often.
Browse on Udemy →Search Amazon for SQL Deep Dive books — check the publication year so the examples match current versions.
Search Amazon →