Given a table of transactions and a table of creator profiles, write a query to find the top 5% of creators by total payout in each geographic region on Patreon.
Include creators with no transactions as having a total payout of zero, exclude profiles without a geographic region, and use a deterministic creator ID tie-breaker. Treat the top 5% as at least one creator per region, using the ceiling of 5% of the regional creator count.
geographic_region, creator_id, creator_name, total_payout, payout_rank, and creator_count.geographic_region, payout_rank, then creator_id.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| creator_id | INT | Creator receiving the payout |
| payout_amount | DECIMAL(12,2) | Payout amount for the transaction |
| Column | Type | Description |
|---|---|---|
| creator_idPK | INT | Unique creator identifier |
| creator_name | VARCHAR(100) | Creator display name |
| geographic_region | VARCHAR(50) | Creator geographic region |