Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

First and Last Order Amounts

For each customer return the amount of their first order and of their latest order. Order by customer.

Table schema

Orders(id INT PRIMARY KEY, customer VARCHAR(10), order_date DATE, amount INT)

Sample data

id | customer | order_date | amount
1 | Ann | 2026-01-01 | 100
2 | Ann | 2026-01-11 | 150
3 | Ann | 2026-02-10 | 90
4 | Bob | 2026-01-05 | 200
5 | Bob | 2026-03-05 | 60

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.