Company: Protium_Finance_15_dec
Difficulty: medium
Department Budget Optimization Analysis Your table: maintable_7JTBU Analyze the budget within departments, identify the top earners, and assess potential areas for budget optimization. Write a query that, for every department , reports: Department Budget Overview : the department id ( DivisionID ) and the total salary allocated to it ( TotalDivisionSalary ). Top Earners Insight : the employee ( Name ) with the highest salary in the department, and that salary ( TopSalary ). Budget Utilization Analysis : the percentage of the total department budget that the top earner's salary represents ( SalaryUtilization ). Underutilized Departments Detection : a column BudgetOptimizationPotential that is Yes if the highest salary in the department is less than 50% of the total department salary, and No otherwise. Common Table Expressions (CTEs) and window functions are a convenient way to organize the query, but any correct query is accepted. Table: maintable_7JTBU Column Data Type Description Divi