Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

8. Consider an Employee table with the following attributes Employee(EMPNO, ENAM

ID: 3588605 • Letter: 8

Question

8. Consider an Employee table with the following attributes Employee(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO) Find the query that is equivalent to the following query: SELECT el.empno, el.sal FROM emp el WHERE el.sal> ALL (SELECT e2.sal FROM emp e2 WHERE e2.deptno = 20); O a) SELECT el.empno, el.sal FROM emp el WHERE el.sal IN (SELECT e2.sal FROM emp e2 WHERE e2.deptno = 20); O b) SELECT el.empno, el.sal FROM emp el WHERE EXISTS (SELECT e2.sal FROM emp e2 WHERE e2.deptno = 20 AND el.sal

Explanation / Answer

C Select e1.empno, el.sal From emp e1 Where NOT EXISTS (select e2.sal FROM emp e2 WHere e2.deptno=20 AND e1.sal<=e2.sal);

is the answer because we need to get the value of salary emp from the table 2 and compare it so the only option is C where it takes the values of neglecting the higer values only the equal to values and remaining values are displayed which are gives the same value as the Question query