Write a query to aggregate monthly transaction data.
Use the provided transaction and account data. Include only posted transactions with a non-null transaction date, and report results by calendar month and account type.
month, account_type, transaction_count, total_amount, and average_amount.month as YYYY-MM and order by month chronologically, then account type alphabetically.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Account associated with the transaction |
| transaction_date | DATE | Date the transaction occurred |
| amount | DECIMAL(12,2) | Transaction amount |
| status | VARCHAR(20) | Transaction processing status |
| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| account_type | VARCHAR(30) | Account classification |
| opened_date | DATE | Date the account was opened |