FunctionRacerProblemsRace

Three Largest

BeginnerSQLSQLite

Return the id and qty of the three trades with the largest qty, the largest first. Ties go to the smaller id. A table with fewer than three trades returns them all.

Example 1

trades
idsymbolqtyprice
1AAPL1020.0
2MSFT5035.5
3AAPL7020.0
4KO509.75
5KO59.8
returns
idqty
370
250
450

Constraints

Race itor take your time

Write it in your browser, against the clock. The model query, with a note on each piece of it, comes after.

More SQL problems