Your question is Top 10 Customers by Sales. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Design a data schema based on a given case, and write a query/logic to select the top 10 customers by sales volume over the past month.
Asked in the HR onsite 1H stage. Schema design and aggregation/ranking case.
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(255) | Customer display name |
| region | VARCHAR(100) | Customer region |
| created_at | DATE | Date the customer record was created |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer who placed the order |
| order_date | DATE | Order date |
| sales_amount | DECIMAL(12,2) | Order sales amount |
| order_status | VARCHAR(20) | Order status such as completed, canceled, or pending |