Your question is 7-Day Rolling Average With SQL. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
MSCI Analytics Platform monitors transaction activity to support customer-level financial analysis. Write a PostgreSQL query that calculates a 7-day rolling average transaction amount for every transaction.
transactions to customers to include the customer name when available.customer_id.| Column | Type | Description |
|---|---|---|
| customer_idPK | INTEGER | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer's display name |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INTEGER | Unique transaction identifier |
| customer_id | INTEGER | Customer associated with the transaction |
| transaction_date | DATE | Calendar date of the transaction |
| amount | NUMERIC(12,2) | Transaction amount |