Multiple choice

Consider the following database table

Table Name- Employe ||||| |---|---|---|---| |Employee_ID|Dept no|Job|Salary| |120|201|Clerk|20,000| |121|202|Manager|22,000| |122|203|Head|32,000| |123|204|Sr. Manager|46,000| |124|205|Boss|40,000| |125|206|HR|23,000| |126|207|Shoes|26,000| ||

Which of the following is the correct query to find the highest salaries for each department in it for each job from the employee table?

  1. SELECT MAX(SAL) FROM Employee GROUP BY DEPTNO, JOB

  2. SELECT DEPTNO, MAX(SAL) FROM Employee GROUP BY DEPTNO, JOB

  3. SELECT DEPTNO, JOB, MAX(SAL) FROM Employee GROUP BY DEPTNO, JOB

  4. SELECT JOB, MAX(SAL) FROM Employee GROUP BY DEPTNO, JOB

  5. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

This is the correct sql query for the desired output.