- select job, avg(sal) from emp group by job
- select ename, job, sal, (select round(avg(sal))from emp where job = e.job) from emp e order by 2, 3
- select rownum, t.* from (select ename, sal from emp order by sal) t where rownum <= 10
- select ename, sal from emp where sal in (select sal from (select ename, sal from emp order by sal desc) where rownum <= 5)
- create table emp3 as (select * from emp where sal > 1000)
- create view emp_v1(Name, Job, Manager) as select ename, job, mgr from emp
- select * from emp_v1
- update emp_v1 set NAME='Chris' where Name = 'phil'
- drop view emp_v1
- create view emp_v1(Name, Job, Manager, Department) as select ename, job, mgr, deptno from emp
- select * from emp_v1 e, dept d where e.department = d.deptno
- create view emp_v2(Name, Job, Department, Location) as select ename, job, e.deptno, loc from emp e, dept d where e.deptno = d.deptno
- select * from emp_v2
- update emp_v2 set Name = 'Smyth' where Name = 'Smith'
This will give an eror - ORA-01779: cannot modify a column which maps to a non key-preserved table
- select job, rpad('*', sal/100, '*') hist from emp order by sal -- histogram
- See Lesson 1 of "Oracle Admin I Vol 1 D62541.pdf"
- Oracle Architecture Overview
- Oracle Instance Architecture
- Oracle Architecture
- Oracle DBMS Concepts
Click here to see the full report. This image comes from page 7 of the report.