Multiple choice technology databases

Use these data for the following Questions EMPNO ENAME SAL A822 RAMASWAMY 3500 A812 NARAYAN 5000 A973 UMESH 2850 A500 BALAJI 5750 Select SAL from EMP E1 where 3 > ( Select count(*) from Emp E2 where E1.SAL > E2.SAL ) will retrieve

  1. 3500,5000,2850

  2. 5000,2850

  3. 2850,5750

  4. 5000,5750

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

This is a correlated subquery finding salaries where fewer than 3 other employees have lower salaries. Count employees with salary less than each E1.SAL: for 5750, count=4 (all others lower); for 5000, count=2; for 3500, count=1; for 2850, count=0. Condition 3 > count is true for salaries 5000, 3500, 2850 where count is 2, 1, 0 respectively.