group 2 PRINT


1) Find all people working as CLERK and employed after ADAMS.

Display results ordered by hire dates.

1) select ename from EMP where job='CLERK' and hiredate>(select hiredate from EMP where ename='ADAMS');

2) Find all jobs which appear both in department 10 and in department 20.

2) select job from EMP where deptno=10 INTERSECT select job from EMP where deptno=20;

3) Find people who earn the lowest salary for their job and grade.

3) select distinct E1.empno,E1.ename,E1.sal,E1.job from EMP E1, SALGRADE S1

where E1.sal=(select min(E2.sal) from EMP E2

where E1.job=E2.job) order by E1.sal;

4) How many people earn less than the maximal salary for the department

located in NEW YORK

4) select count(empno) from EMP where sal<(select max(sal) from EMP where

deptno=(select D.deptno from DEPT D where D.loc='NEW YORK'));

5) For each manager find the number of his subordinate. Display name of

the manager and the number of people working under his supervision.

5)

6) Find all employees (personal number, name, profession and salary),

who earn less than the average salary for people with salaries in the third

grade. Display results order by salaries ascending.

6) select empno,ename,job,sal from EMP where

sal<(select avg(sal) from EMP,SALGRADE where sal between losal and hisal

and grade=3) order by sal asc;

7) For each job in each grade find the average yearly incomes.

Order result by jobs.

7) select distinct job,avg(sal*12+NVL(comm,0)),grade from EMP,SALGRADE

where sal between losal and hisal

group by job,grade;

8) Display names, jobs and hire dates for all employees working in DALLAS.

Order results by names.

8) select ename,job,hiredate from EMP,DEPT where EMP.deptno=DEPT.deptno

and DEPT.loc='DALLAS' order by ename;

9) Show all values of salaries from the 3-rd grade earned by people from

Dallas (don't repeat the same values)

9) select distinct sal from EMP,DEPT,SALGRADE where sal between losal and hisal

and EMP.deptno=DEPT.deptno

and DEPT.loc='DALLAS'

and SALGRADE.grade>=3;

10) Find the number of people who don't supervise the others.

10) select count(*) from EMP M

where not exists ( select null from EMP E where E.mgr = M.empno );



Wyszukiwarka

Podobne podstrony:
group 4 PRINT
group 1 PRINT
group 3 PRINT
Multilayer Composite Print 2
5 Maerchen PRINT
jp5 print
Lista odpowiedników FM Group
FEDERICO MAHORA-katalog, PRASA, FM Group
Multilayer Composite Print (3)
pcb pdf, Top Paste Mask Print
Multilayer Composite Print
Multilayer Composite Print
pedagogika Piaget i Wygotski, 2009-2012 (Graduates), GROUP 6, Pedagogika
Golden Delicious Group Payback 2007 12
l16 print
Print your own organs[1]
tpd print screeny
Grammar Test Group?iE

więcej podobnych podstron