Pick the largest transactions for audit sampling
For each subsidiary, the audit sample is every transaction larger than 90% of that subsidiary's own average transaction size.
Return subsidiary, txn_id and amount for every transaction that qualifies.
Schema
▸transactions
| txn_id | INT |
| subsidiary | TEXT |
| amount | NUMERIC |
Example input
▸transactions
Stuck? Ask the coach for a nudge that won't give the answer away, or reveal the reference solution and a short walkthrough of why it works.