Given a table of transactions and a table of customer profiles, write a query to find the top 5% of senders by total volume in the last 30 days at Remitly.
Use completed transactions and match senders to their customer profiles. Treat ties at the 5% boundary as included.
sender_id, customer_name, and total_volume.total_volume descending, then sender_id ascending.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| sender_id | INT | Customer who initiated the transfer |
| amount | NUMERIC(12,2) | Transfer amount in the transaction currency |
| currency | VARCHAR(3) | ISO currency code |
| transaction_status | VARCHAR(20) | Processing status of the transaction |
| transaction_timestamp | TIMESTAMP | Time the transaction was recorded |
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique Remitly customer identifier |
| customer_name | VARCHAR(150) | Customer's display name |
| VARCHAR(255) | Customer email address | |
| country_code | VARCHAR(2) | Customer's two-letter country code |