Return
day: the datetotal_revenue: total sales revenue from all regions for that day (NULL if no sales)moving_avg_revenue: average daily total revenue over the current and previous 6 days (NULL if fewer than 7 days of data)signup_count: number of user signups on that day
Show all days from the signups table, even if there were no sales, and order the results by day in ascending order.Expected output
| day | total_revenue | moving_avg_revenue | signup_count |
|---|---|---|---|
| 2023-01-01 | 2255 | 2255 | 33 |
| 2023-01-02 | 4141 | 3198 | 61 |
| 2023-01-03 | 4182 | 3526 | 61 |
First 3 of 41 rows your query should return. Your column aliases don't need to match.