Your question is Rolling 7-Day Transaction Average. 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.
Truist analysts need to monitor short-term customer transaction activity across accounts. Write a PostgreSQL query that calculates a rolling 7-day average of each customer's daily transaction total.
| Column | Type | Description |
|---|---|---|
| customer_idPK | INTEGER | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer's display name |
| segment | VARCHAR(30) | Customer segment |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INTEGER | Unique transaction identifier |
| customer_id | INTEGER | References customers.customer_id |
| transaction_date | DATE | Transaction posting date |
| amount | NUMERIC(12,2) | Transaction amount |