Can you provide an example of a business-flavored SQL query you have written for American Express operations or transaction processing?
Using the supplied American Express merchant and transaction tables, return qualifying merchant activity for January 2025. Include merchants with at least two transactions during the period and calculate their approval metrics.
merchant_id, merchant_name, transaction_count, approved_transaction_count, approved_amount, and approval_rateapproved_amount descending, then merchant_id ascending| Column | Type | Description |
|---|---|---|
| merchant_idPK | INT | Unique merchant identifier |
| merchant_name | VARCHAR(100) | Merchant display name |
| merchant_category | VARCHAR(50) | Merchant category |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| merchant_id | INT | Merchant associated with the transaction |
| transaction_date | DATE | Date the transaction was processed |
| amount | DECIMAL(12,2) | Transaction amount in US dollars |
| status | VARCHAR(20) | Transaction processing status |