Write a single SQL query that returns exactly two rows containing specific aggregated metrics, using conditional aggregation or precise filtering instead of an unnecessary union.
Use the accounts and transactions tables. Return metrics for the pro and standard account tiers, excluding accounts with another or missing tier.
pro first and standard second.account_tier, posted_transaction_count, and posted_amount.posted; treat a missing matching amount as zero.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| account_tier | VARCHAR(20) | Account tier used for reporting |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Account associated with the transaction |
| status | VARCHAR(20) | Transaction processing status |
| amount | NUMERIC(10,2) | Transaction amount |