aupdate emp set salsalsal10100 where comm is null 100SELECT those employee who

Aupdate emp set salsalsal10100 where comm is null

This preview shows page 9 - 12 out of 26 pages.

a)update emp set sal=sal+sal*10/100 where comm is null; 100)SELECT those employee who joined the company before 31-dec-82 while their dept location is newyork or Chicago. a)SELECT EMPNO,ENAME,HIREDATE,DNAME,LOC FROM EMP,DEPT WHERE (EMP.DEPTNO=DEPT.DEPTNO)AND HIREDATE <'31-DEC-82' AND DEPT.LOC IN('CHICAGO','NEW YORK'); 101)DISPLAY EMPLOYEENAME,JOB,DEPARTMENT,LOCATION FOR ALL WHOAREWORKING AS MANAGER? A)select ename,JOB,DNAME,LOCATION from emp,DEPT where mgr is not null; 102)dISPLAY THOSE EMPLOYEES WHOSEMANAGER NAME IS JONES? --[AND ALSODISPLAY THEIR MANAGER NAME]? A) SELECT P.ENAME FROM EMP E, EMP P WHERE E.EMPNO=P.MGR AND E.ENAME='JONES';
Image of page 9
103)Display name and salary of ford if his salary is equal to hisal of his grade a)select ename,sal,grade from emp,salgrade where sal between losal and hisal and ename ='FORD' AND HISAL=SAL; 104)Display employee name,job,depart name,manager name,his grade andmake out an under department wise? a)SELECT E.ENAME,E.JOB,DNAME,EMP.ENAME,GRADE FROM EMP,EMP E,SALGRADE,DEPT WHERE EMP.SAL BETWEEN LOSAL AND HISAL AND EMP.EMPNO=E.MGR AND EMP.DEPTNO=DEPT.DEPTNO ORDER BY DNAME 105)List out all employees name,job,salary,gradeand depart name for every one in the companyexcept 'CLERK'.Sort on salary display the highestsalary? a)SELECT ENAME,JOB,DNAME,SAL,GRADE FROM EMP,SALGRADE,DEPT WHERE SAL BETWEEN LOSAL AND HISAL AND EMP.DEPTNO=DEPT.DEPTNO AND JOB NOT IN('CLERK')ORDER BY SAL ASC; 106)Display the employee name,job and hismanager.Display also employee who are withoutmanager? a)select e.ename,e.job,eMP.ename AS Manager from emp,emp e where emp.empno(+)=e.mgr 107)Find out the top 5 earners of company? a)SELECT DISTINCT SAL FROM EMP E WHERE 5>=(SELECT COUNT(DISTINCT SAL) FROM EMP A WHERE A.SAL>=E.SAL)ORDER BY SAL DESC; 108)Display name of those employee who aregetting the highest salary? a)select ename from emp where sal=(select max(sal) from emp); 109)Display those employee whose salary isequal to average of maximumand minimum? a)select ename from emp where sal=(select max(sal)+min(sal)/2 from emp); 110)Select count of employee in each departmentwhere count greater than 3? a)select count(*) from emp group by deptno having count(deptno)>3 111)Display dname where at least 3 are workingand display onlydepartment name? a)select distinct d.dname from dept d,emp e
Image of page 10
where d.deptno=e.deptno and 3>any (select count(deptno) from emp group by deptno)
Image of page 11
Image of page 12

You've reached the end of your free preview.

Want to read all 26 pages?

  • Winter '17
  • emp

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture