Your question is Running Total Over 7 Days. 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.
Accenture SynOps uses an operations dashboard to monitor daily transaction revenue. Write a PostgreSQL query that calculates the revenue for each calendar date and the rolling revenue total for that date and the six preceding calendar days.
0.reporting_calendar.A transaction with a NULL amount contributes no revenue. Transactions without a valid calendar date are outside the reporting calendar and should not appear in the result.
| Column | Type | Description |
|---|---|---|
| calendar_datePK | DATE | Calendar date included in reporting |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| transaction_date | DATE | Date on which the transaction occurred |
| amount | NUMERIC(10,2) | Transaction revenue |
| channel | VARCHAR(30) | Source channel for the transaction |