How would you calculate a running total of revenue by date in SQL?
Write a PostgreSQL query using the revenue_transactions table. Combine all transactions from the same date into one daily result, treating missing revenue as zero.
revenue_date, daily_revenue, and running_total.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| revenue_date | DATE | Date on which the revenue transaction occurred |
| revenue | NUMERIC(12,2) | Revenue amount for the transaction |