Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from emp
- select * from dept
- 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')
- 2.select sum(salary+nvl(comm,0)) from emp,dept where emp.deptno=dept.deptno and dname= 'SALES' and job= 'SALESMAN'
- 3.select loc,count(*),round(avg(salary),2) from emp,dept where emp.deptno=dept.deptno group by loc
- 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
- 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)
- 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)
- 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