Given an orders table (order id, order price, restaurant id) and a restaurants table, find the amount of each restaurant's first order.
Asked in the technical stage. Treat the earliest order_placed_at as the first order. If timestamps tie, use the lowest order_id as the tie-breaker.
restaurant_id, restaurant_name, and first_order_amount.restaurant_id ascending. Return NULL when a restaurant has no orders or its first order amount is NULL.| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| order_price | NUMERIC(10,2) | Total price of the order |
| restaurant_id | INT | Restaurant associated with the order |
| order_placed_at | TIMESTAMP | Timestamp when the order was placed |
| Column | Type | Description |
|---|---|---|
| restaurant_idPK | INT | Unique restaurant identifier |
| restaurant_name | VARCHAR(120) | Restaurant display name |