Describe your experience with SQL optimization for large-scale datasets. For a hands-on demonstration, write a PostgreSQL query that summarizes qualifying transactions for active accounts during the first quarter of 2025. The result should exclude accounts whose quarterly net amount is not positive.
account_id, account_type, transaction_count, and total_amount.total_amount descending, then account_id ascending.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| account_type | VARCHAR(30) | Deposit or lending account category |
| status | VARCHAR(20) | Current account status |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Account associated with the transaction |
| posted_at | DATE | Date the transaction posted |
| amount | DECIMAL(12,2) | Signed transaction amount |
| transaction_type | VARCHAR(20) | Transaction classification |