Fleet Zones with Multiple Robots | Chill Interview
Fleet Zones with Multiple Robots
Asked by:
MicrosoftScreening
A fulfillment center assigns each warehouse robot to a specific operating zone. The fleet team wants to identify zones where multiple robots are available to share the workload.
Table: warehouse_robots
+-------------+--------------+
| Column Name | Type |
+-------------+--------------+
| robot_id | integer |
| robot_name | varchar(255) |
| zone | varchar(255) |
| model | varchar(255) |
| battery_pct | integer |
+-------------+--------------+
+-------------+--------------+
| Column Name | Type |
+-------------+--------------+
| robot_id | integer |
| robot_name | varchar(255) |
| zone | varchar(255) |
| model | varchar(255) |
| battery_pct | integer |
+-------------+--------------+
robot_id is the primary key. Each row represents one robot and its assigned zone. zone is never NULL.
Return every zone containing more than one robot, together with the number of robots assigned to that zone.
Return zone and robot_count. Order the results by zone ascending. If no zone has multiple robots, return no rows.