SQL interview question: Each customer's first order
medium
ROW_NUMBER
top-N per group
For each customer who has ordered, return their name, the date of their first order and its amount. If a customer placed two orders on their first day, return the one with the lower order id.
Expected columns: name, first_order_date, amount. Column names don't have to match. Runs on SQLite in your browser.
Tables: customers + orders
Your query
Ctrl/Cmd + Enter