Practice Interview Questions
| Question | Status |
|---|---|
In this task, your goal is to determine the city that had the most profitable month in the year 2023. The output will display the city, the corresponding most profitable month, and the profit achieved during that period.
In case of ties in profit, display all results that share the top spot.
orders table:
| Column Name | Description |
|---|---|
| order_id | Unique identifier for each order |
| customer_id | Identifier of the rider |
| driver_id | Identifier of the driver |
| country | The order's country of origin |
| city | The order's city of origin. |
payment_details table:
| Column Name | Description |
|---|---|
| order_id | Identifier for the order |
| order_date | Time when the order was placed. |
| promo_code | Promo code used (true/false) |
| order_fare | Total fare amount of the order |
| city | month | profit |
|---|---|---|
| San Francisco | 3 | 4321 |
In this task, your goal is to determine the city that had the most profitable month in the year 2023. The output will display the city, the corresponding most profitable month, and the profit achieved during that period.
In case of ties in profit, display all results that share the top spot.
orders table:
| Column Name | Description |
|---|---|
| order_id | Unique identifier for each order |
| customer_id | Identifier of the rider |
| driver_id | Identifier of the driver |
| country | The order's country of origin |
| city | The order's city of origin. |
payment_details table:
| Column Name | Description |
|---|---|
| order_id | Identifier for the order |
| order_date | Time when the order was placed. |
| promo_code | Promo code used (true/false) |
| order_fare | Total fare amount of the order |
| city | month | profit |
|---|---|---|
| San Francisco | 3 | 4321 |