Examine the description of the EMPLOYEES table: EMP_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) JOB_CAT VARCHARD2(30) SALARY NUMBER(8,2) Which statement shows the maximum salary paid in each job category of each department?

  1. SELECT dept_id, job_cat, MAX(salary)

  2. ELECT dept_id, job_cat, MAX(salary)

  3. SELECT dept_id, MAX(salary)

  4. SELECT dept_id, salary


Correct Option: B

AI Explanation

To find the maximum salary paid in each job category of each department from the EMPLOYEES table, we need to group the data by department and job category and then find the maximum salary within each group.

The correct statement to achieve this is:

B. SELECT dept_id, job_cat, MAX(salary)

Explanation:

Option A) SELECT dept_id, job_cat, MAX(salary) - This option includes all the necessary columns and the MAX(salary) function to find the maximum salary. This is the correct statement.

Option B) SELECT dept_id, job_cat, MAX(salary) - This option is the correct statement as it includes all the necessary columns and the MAX(salary) function to find the maximum salary.

Option C) SELECT dept_id, MAX(salary) - This option does not include the job_cat column, so it will not show the maximum salary per job category. Therefore, this option is incorrect.

Option D) SELECT dept_id, salary - This option does not include the MAX(salary) function to find the maximum salary. It will simply display the salary column for each department. Therefore, this option is incorrect.

The correct answer is B. SELECT dept_id, job_cat, MAX(salary). This statement includes all the necessary columns and the MAX(salary) function to find the maximum salary paid in each job category of each department.

Find more quizzes: