Advertisement
Guest User

rafi

a guest
Mar 27th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. select * from emp
  2. select * from dept
  3. 1.select empno,ename,loc,salary,dname from emp,dept where emp.deptno=dept.deptno and dname = (select dname from emp, dept where emp.deptno=dept.deptno and ename= 'KING')
  4. 2.select sum(salary+nvl(comm,0)) from emp,dept where emp.deptno=dept.deptno and dname= 'SALES' and job= 'SALESMAN'
  5. 3.select loc,count(*),round(avg(salary),2) from emp,dept where emp.deptno=dept.deptno group by loc
  6. 4.select empno,ename,salary,dname from emp, dept where emp.deptno=dept.deptno and job= 'ANALYST' and empno in (select mgr from emp) and dname in ('NEW YORK','DALLAS') and months_between(sysdate,hiredate)/12>7 and nvl(comm,0)=0 order by loc asc
  7. 5.select job,sum(salary+nvl(comm,0)) from emp group by job having sum(salary+nvl(comm,0))= (select max(sum(salary+nvl(comm,0))) from emp group by job)
  8. 6.select loc,count(*) from emp,dept where emp.deptno=dept.deptno group by loc having count(*)=( select max(count(*)) from emp,dept where emp.deptno=dept.deptno group by loc)
  9. 7.select * from emp where deptno in (10,20) and job in ('CLERK','ANALYST') and salary<9999 and salary>99 and months_between(sysdate,hiredate)/12>8 and to_char(hiredate,'mon') not in ('MAR','APR','SEP') and empno in (select mgr from emp) and empno not like '%88' and empno not like '%56'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement