BasicSorting & Limits10 points

The five biggest cheques in the transfer market

The league's media team is preparing a graphic about the most expensive signings. Every move is stored in transfers with the fee in millions of USD (fee_musd), and the buying club is referenced by to_club_id.

Task: return the top 5 transfers by fee with the columns player (the player's name), buying_club (the club's name) and fee_musd. Sort by fee_musd from high to low and break ties by player from A to Z.

The data you can query

Each table is shown with its column types and the first rows, so you can see exactly what the data looks like.

clubs10 rows
club_id INTEGERname TEXTcity TEXTstadium_capacity INTEGER
1Harbor City FCHarbor City48000
2Rivermoor UnitedRivermoor36000
3Atlas AthleticPort Atlas41000
4Solent AlbionSolent Bay29000
5Kestrel TownKestrel22000
6Ironbridge WanderersIronbridge33000

Showing the first 6 of 10 rows.

goals222 rows
goal_id INTEGERmatch_id INTEGERplayer_id INTEGERclub_id INTEGERminute INTEGER
112153
215166
3262932
4214277
5321359
6321365

Showing the first 6 of 222 rows.

matches90 rows
match_id INTEGERseason TEXTmatchweek INTEGERmatch_date TEXThome_club_id INTEGERaway_club_id INTEGERhome_goals INTEGERaway_goals INTEGER
12025-2612025-08-0911020
22025-2612025-08-092911
32025-2612025-08-093822
42025-2612025-08-094723
52025-2612025-08-095631
62025-2622025-08-239100

Showing the first 6 of 90 rows.

players70 rows
player_id INTEGERname TEXTclub_id INTEGERposition TEXTnationality TEXTbirth_date TEXT
1Oliver Hughes1GKUnited Kingdom1996-02-16
2Mateusz Nowak1DFPoland2003-12-02
3Caleb Brooks1DFUnited States2000-06-16
4Nour Salem1MFEgypt2006-02-25
5Kofi Owusu1MFGhana1994-08-02
6Ethan Hayes8FWUnited States1995-10-27

Showing the first 6 of 70 rows.

transfers26 rows
transfer_id INTEGERplayer_id INTEGERfrom_club TEXTto_club_id INTEGERtransfer_date TEXTfee_musd REAL
12Dunmore Athletic12024-10-012.5
25Santa Rosa SC12024-11-058
38FC Lindenberg22025-07-1118
411Real Costa Verde22025-04-180
514Nordhavn IF22025-02-074
617Olympia Kallithea32024-09-1015

Showing the first 6 of 26 rows.

Your query runs on SQLite. Write a single SELECT; use LIMIT instead of TOP.

Need a hint?

ORDER BY with two keys, then LIMIT 5. The tie-break is the second sort key.