1 / 10

Wrong answer:

Find the names of all employees whose salary greater than some manager ’ s salary . EMP(E#, Ename , Sal, D#, MGR#) DEPT(D#, Dname, MGR). Wrong answer:. Where E.sal > (select EMP.sal From EMP, DEPT where EMP.ename = DEPT.MGR)

lynnea
Download Presentation

Wrong answer:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Find the names of all employees whose salary greater than some manager’s salary .EMP(E#, Ename , Sal, D#, MGR#)DEPT(D#, Dname, MGR)

  2. Wrong answer: • Where E.sal > (select EMP.sal From EMP, DEPT where EMP.ename = DEPT.MGR) • Select department From class where employee.sal > some managers.sal • Where (E.sal > sal from emp) • Where (e.sal > sal where mgr =”true’)

  3. select Ename from emp wher EMp.sal> mgrsal • Forall empx.ename (salary > dept.sal) • Where sal > (select sal from manager where name =”someone”) • Select a.ename from EMP a,b Where forall b.sal (a.sal > b.sal) and a.mgr =0 and b.mgr =1

  4. Where (count(EMP. Sal >5000)>= 5) • Where having count (select sal >5000 from EMP)

  5. correct answer: select Ename From EMP Where Salary>(select min(salary) from EMP where E# in (select mgr from DEPT)) select Ename From EMP Where Salary>(select min(salary) from EMP,DEPT where EMP.E#=DEPT.mgr)

  6. select Ename From EMP Where Emp.Salary>some(select min(salary) from EMP where E# in (select mgr# from DEPT))

  7. 2. Find the names of all employeeswhose salary greater than all manager’s salary .

  8. correct answer: select Ename From EMP Where Salary>(select max(salary) from EMP where E# in (select mgr from DEPT)) select Ename From EMP Where Salary>(select max(salary) from EMP,DEPT where EMP.E#=DEPT.mgr)

  9. 3.Find all departments’ name which have at leastfive employees whose salary grater than $5000.

  10. Correct answer Select Dname From DEPT Where (select count(E#) from Emp where Emp.D#=Dept.D# and Emp.sal>5000)>=5;

More Related