0586. Customer Placing the Largest Number of Orders
Description
+-----------------+----------+
| Column Name | Type |
+-----------------+----------+
| order\_number | int |
| customer\_number | int |
+-----------------+----------+
order\_number is the primary key for this table.
This table contains information about the order ID and the customer ID.Orders table:
+--------------+-----------------+
| order\_number | customer\_number |
+--------------+-----------------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 3 |
+--------------+-----------------+
Result table:
+-----------------+
| customer\_number |
+-----------------+
| 3 |
+-----------------+
The customer with number 3 has two orders, which is greater than either customer 1 or 2 because each of them only has one order.
So the result is customer\_number 3.ac
Last updated