How would you use SQL to identify the top bottlenecks in a supply chain process from transactional data at Ab Inbev Gcc India?
Use the supplied shipment, event, and process-stage data. Treat completed events for non-cancelled shipments as the analysis population, require at least two events per stage, and identify bottlenecks by average excess duration.
Output
- Return the top three stages, one row per stage.
- Include
stage_code, stage_name, event_count, expected_hours, avg_duration_hours, avg_delay_hours, delayed_pct, and bottleneck_rank.
- Order by bottleneck rank, with average delay and stage code providing deterministic tie-breaking.