You are on page 1of 6

THC HNH ORACLE TUN 3

Nhm 9 THC HNH CA 2


H v tn: MSSV:
Hong Quc Vng 5451074092
Ng Hoi Nam 5451074056

Cu 1:
select empno, HIREDATE, ADD_MONTHS(HIREDATE, 12) as NgayXetNangLuong
from EMP
ORDER

BY

Cu 2:

Cu 3:
SELECT TO_CHAR(SYSDATE, 'DAY') as DAY
from dual;

NgayXetNangLuong;

Cu 4:
Select e.ename emp_name, e.sal emp_sal, m.ename mgr_name, m.sal mgr_sal
from emp e, emp m
where e.mgr = m.empno
and e.sal <m.sal;

Cu 5:
select ename, job from emp
where job in (select job from emp where ENAME = 'SMITH' or ENAME='BLAKE');

Cu 6:
Select dept.deptno, dname, round(avg(sal), 2)
from scott.emp, scott.dept
where emp.deptno = dept.deptno
group by dept.deptno, dname
having avg(sal) > (select avg(sal) from scott.emp where deptno = 30);

Cu 7:
Cu 8:
Select * from scott.emp
where sal >= all (select distinct sal from scott.emp where deptno = 30)
order by sal desc;

Cu 9:

You might also like