Workday helps companies optimize their organizational structure. One key metric is the "Span of Control." If a department has too many managers relative to the number of staff members, it might be over-leveraged or top-heavy.
Write a query to find departments where the ratio of Managers to Staff is greater than 1:15 (i.e., more than 1 manager for every 15 staff members).
Rules:
- An employee is a Manager if their job_title contains the word Manager (case-insensitive).
- All other employees are considered Staff.
- The ratio calculation is: (Number of Managers / Number of Staff).
- Only include departments that have at least one Staff member to avoid division by zero.
- Output columns: department_name, manager_count, staff_count, manager_to_staff_ratio.
- Sort by manager_to_staff_ratio descending, then department_name ascending.