Argus Information & Advisory Services needs a daily view of which credit card products generate the highest settled transaction volume. Write a PostgreSQL query that calculates and ranks product volume for each reporting date.
report_date. Include transactions newer than report_date - INTERVAL '30 days' and on or before the report date.0.| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique credit card product identifier |
| product_name | VARCHAR(100) | Credit card product name |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| product_id | INT | Credit card product used for the transaction |
| transaction_date | DATE | Date on which the transaction occurred |
| amount | NUMERIC(12,2) | Transaction amount |
| status | VARCHAR(20) | Transaction processing status |
| merchant_category | VARCHAR(40) | Merchant category associated with the transaction |
| Column | Type | Description |
|---|---|---|
| report_datePK | DATE | Date for a rolling-volume snapshot |