SQL QuestSQL Interview Questions › Joins

FX Fee Take Rate by Currency

HardProQuerying BasicsJoinsAggregation & Grouping

FX is where a multi-currency neobank earns its margin, and a take rate is read in basis points. Exchanges are transactions with type = 'fx_exchange'; the currency column holds the currency bought, and currencies names it. Use completed exchanges only.

Return code, name, exchanges (row count), volume_gbp (SUM of amount_gbp), fees_gbp (SUM of fee_gbp) — both rounded to 2 decimals — and fee_bps (10000.0 * fees / volume, rounded to 1 decimal). One row per currency. Order by fees_gbp descending.

Solve it in the browser editor →

Runs on SQLite in your browser, graded against the expected result, no signup. A wrong answer gets a diagnosis, not just "incorrect".

Schema

transactions

txn_iduser_idtstypeamountcurrencyamount_gbpfee_gbpmerchant_categorymerchant_countrycounterparty_user_idstatusdecline_reason
112025-06-14 11:01:51fx_exchange32271.15JPY167.811.68NULLNULLNULLcompletedNULL
212025-06-14 11:17:45bill_payment59.53EUR50.60utilitiesIENULLcompletedNULL
372025-06-16 10:06:38card_payment122.27EUR103.930shoppingESNULLcompletedNULL

currencies

codenamerate_to_gbp
GBPPound sterling1
EUREuro0.85
USDUS dollar0.78

Expected output: code=PLN, name=Polish złoty, exchanges=17, volume_gbp=6482.97, fees_gbp=22.42, fee_bps=34.6 ...

Hint

This is a Pro challenge — the hint, the step-by-step tutor and the reference solution open in the app.

Concepts

SELECT JOIN GROUP BY SUM COUNT JOIN + Aggregation

Practise the topic: SQL practice questions · JOIN practice · GROUP BY exercises · Advanced SQL interview questions

In these company practice sets

Revolut

A SQL Quest challenge matched to patterns reported for these companies — not a question any of them has published.

Related questions

Multi-CTE Revenue PipelineHard · FreeEmployees Earning More Than ManagerHard · ProEmployees with Similar SalariesHard · ProMoving Average with Dynamic WindowHard · ProDetect Repeat Buyers Within 7 DaysHard · ProRecursive Team Size RollupHard · Pro

Where would this cost you points in an interview?

Ten questions, no signup: a Skillmap across nine SQL skills and the one to fix first.

Take the readiness test