Write a query to find the average transaction amount for each country on WePay, excluding transactions marked as fraud.
Use the provided WePay country and transaction data. Include countries with no eligible transactions, returning a NULL average for those countries.
country and average_transaction_amount.country.| Column | Type | Description |
|---|---|---|
| country_idPK | INT | Unique country identifier |
| country_name | VARCHAR(100) | Country name displayed in reports |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| country_id | INT | Country associated with the transaction |
| amount | DECIMAL(12,2) | Transaction amount |
| is_fraud | BOOLEAN | Whether the transaction was marked as fraud |