Monthly Revenue Indexed to the First Month

medium
Unit 16 · Window Functions IX0/2 to milestone

Return each month with orders (YYYY-MM), its revenue, and index_vs_first: revenue as a percentage of the first month's revenue, rounded to 1 decimal (the first month is 100.0). Sort by month.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#window-functions#indexing1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Monthly Revenue Indexed to the First Month · TechGradify