When Amazon's customer service team reviews an order, they will likely want to know as much information as possible about that order. What was the order_id of the customer, what is his or her name, etc. Using the orders and customers tables, return order_id, customer_name, amount, and created_at for every order, ordered by created_at.
customers
| column | type |
|---|---|
| id | INTEGER |
| name | TEXT |
| TEXT |
orders
| column | type |
|---|---|
| id | INTEGER |
| customer_id | INTEGER |
| amount | NUMERIC |
| created_at | DATE |
customers
| id | name | |
|---|---|---|
| 1 | Alice | alice@example.com |
| 2 | Bob | bob@example.com |
| 3 | Carol | carol@example.com |
orders
| id | customer_id | amount | created_at |
|---|---|---|---|
| 1 | 1 | 99.99 | 2024-01-10 |
| 2 | 3 | 49.50 | 2024-02-15 |
| 3 | 2 | 200.00 | 2024-03-01 |
| order_id | customer_name | amount | created_at |
|---|---|---|---|
| 1 | Alice | 99.99 | 2024-01-10 |
| 2 | Carol | 49.50 | 2024-02-15 |
| 3 | Bob | 200.00 | 2024-03-01 |
Order 1 belongs to customer 1 (Alice), order 2 to customer 3 (Carol), and order 3 to customer 2 (Bob). Rows are sorted by order date ascending.