FunctionRacerProblemsRace

Biggest Spender

EasySQLSQLite

Return one row: the customer_id whose orders add up to the most, and that sum as spent. If customers tie, return the one with the smallest customer_id.

Example 1

orders
idcustomer_idamount
17100
28250
37200
49300
returns
customer_idspent
7300

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