Your question is Running 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.
Plaid wants to monitor transaction activity for users connected through Plaid Transactions. Write a PostgreSQL query that calculates a calendar-aware rolling 7-day average of daily transaction counts for each active user.
| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Plaid user identifier |
| user_name | VARCHAR(100) | User display name |
| account_status | VARCHAR(20) | User account status |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| user_id | INT | User associated with the transaction |
| transaction_date | DATE | Transaction posting date |
| merchant_name | VARCHAR(100) | Merchant associated with the transaction |
| amount | NUMERIC(10,2) | Transaction amount |