Build an Expense Analytics Report (SQL)
Go from a raw expenses table to a real monthly report in SQL - grouping, aggregates, and window functions - all runnable in your browser.
- The Schema and Seed Data Create the expenses table and fill it with a few dozen realistic rows you can query for the rest of the project.
- Totals and Groups Collapse the raw rows into spend per category and spend per month using GROUP BY and SUM.
- Running Totals with Window Functions Compute a running total and a month-over-month change with SUM() OVER and LAG, keeping every row instead of collapsing it.
- The Final Report Fold category share-of-total and the month-over-month trend into one report query you could drop into a dashboard.