You need to fetch the first names (in a reverse alphabetical order) of all the employees in the department ID = 100 and who have the maximum salary in the JOB ID = 'SA_REP'. Which of the following queries will give the required output? (Choose the most appropriate output) O SELECT E first_name, job_id, salary FROM employees E WHERE salary IN (SELECT max(salary) FROM employees E1 WHERE E1.department_id = 100 GROUP BY job_id) ORDER BY first_name o SELECT E.first_name, job_id, salary FROM employees E WHERE salary = (SELECT max(salary) FROM employees E1 WHERE E1.department_id = 100 GROUP BY job_id ) AND job_id = "SA_REP ORDER BY first_name O SELECT E first_name, job_id, salary FROM employees E WHERE salary IN (SELECT max(salary) FROM employees E1 where job_id = 'SA_REP GROUP BY job_id) AND WHERE E.department_id = 100 ORDER BY first_name desc: O SELECT E first_name, job_id, salary FROM employees E WHERE salary in (SELECT max(salary) FROM employees E1 where E1.department_id = 100) ORDER BY first_name,

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter12: Subqueries And Merge Statements
Section: Chapter Questions
Problem 15MC
icon
Related questions
Question
100%
You need to fetch the first names (in a reverse alphabetical order) of all the employees in the department ID = 100 and who have the maximum salary in the JOB ID = 'SA_REP'. Which of the following queries will give the
required output? (Choose the most appropriate output)
O SELECT E.first_name, job_id, salary FROM employees E WHERE salary IN
(SELECT max(salary) FROM employees E1 WHERE E1.department_id = 100
GROUP BY job id ) ORDER BY first name
O SELECT E.first_name, job_id, salary FROM employees E WHERE salary =
(SELECT max(salary) FROM employees E1 WHERE E1.department_id = 100 GROUP BY job_id ) AND job_id = 'SA_REP' ORDER BY first_name;
O SELECT E.first_name, job_id , salary FROM employees E WHERE salary IN (SELECT max(salary) FROM employees E1 where job_id = 'SA_REP' GROUP BY job_id ) AND WHERE E.department_id = 100 ORDER BY first_name desc;
O SELECT E.first name, job id, salary FROM employees E WHERE salary in
(SELECT max(salary) FROM employees E1
where E1.department_id = 100) ORDER BY first_name;
Transcribed Image Text:You need to fetch the first names (in a reverse alphabetical order) of all the employees in the department ID = 100 and who have the maximum salary in the JOB ID = 'SA_REP'. Which of the following queries will give the required output? (Choose the most appropriate output) O SELECT E.first_name, job_id, salary FROM employees E WHERE salary IN (SELECT max(salary) FROM employees E1 WHERE E1.department_id = 100 GROUP BY job id ) ORDER BY first name O SELECT E.first_name, job_id, salary FROM employees E WHERE salary = (SELECT max(salary) FROM employees E1 WHERE E1.department_id = 100 GROUP BY job_id ) AND job_id = 'SA_REP' ORDER BY first_name; O SELECT E.first_name, job_id , salary FROM employees E WHERE salary IN (SELECT max(salary) FROM employees E1 where job_id = 'SA_REP' GROUP BY job_id ) AND WHERE E.department_id = 100 ORDER BY first_name desc; O SELECT E.first name, job id, salary FROM employees E WHERE salary in (SELECT max(salary) FROM employees E1 where E1.department_id = 100) ORDER BY first_name;
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage