Company: UST
Difficulty: medium
Salary Query Optimization You want to find the maximum salary of the employees. Write an SQL query that displays the maximum salary of the employees based on the month in which they were hired. Table: EMPLOYEE Column Type Description EMP_NO INT Employee number (primary key) EMP_NAME VARCHAR(50) Employee name HIRE_DATE DATE Date on which the employee was hired, stored as YYYY-MM-DD EMP_SALARY INT Salary of the employee; may be NULL DEPT_ID INT Id of the department where the employee works Expected Output Return the following columns, in this order: Column Description month The month number of HIRE_DATE , an integer from 1 to 12 max_salary The highest EMP_SALARY among the employees hired in that month Rules Employees are grouped by the month only : an employee hired in October 2020 and one hired in October 1990 belong to the same group, month 10 . Return one row for every month in which at least one employee was hired, and no row for a month in which nobody was hired. month is a plain in