FunctionRacerProblemsRace

First Order

MediumSQLSQLite

Return each customer's first order: the customer_id, and the day and amount of that customer's order with the earliest day. When a customer has two orders on their earliest day, the first is the one with the smaller id. Rows may come in any order.

Example 1

orders
idcustomer_iddayamount
172026-01-09100
282026-01-03250
372026-01-0430
582026-01-0340
returns
customer_iddayamount
72026-01-0430
82026-01-03250

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