Three-month smoothing
Monthly revenue swings hard from month to month. Smooth the curve: for every month show revenue and moving_avg — the average of that month plus the two months before it, rounded to 2 decimals. Getting monthly revenue first (via a subquery) keeps the window simple.
Tables in this exercise
invoices
id customer_id invoice_date billing_city billing_country total