View: A query statement that can correspond to one or more tables
-- create a view without querying payroll Create or Replace View V_normal as Select e.empno,e.ename,e.job,e.mgr,e.hiredate from EMP E Order by E.hiredate
--Query results as a table to correlate queries--Views: Shows the average salary, department number, department name, average salary for each departmentCreate or Replace ViewV_avg asSelectRes.*, D.dname from(SelectE.deptno,avg(SAL) fromEMP EGroup byE.deptno) res,dept DwhereRes.deptno=D.deptno
With Read only
--View becomes read-only
Sequence:
Oracle database provides an object called sequence
Sequence: is an object that stores a numeric value that can be set initially (default is 1) to set the next value more than the previous value (default is 1), each time the resulting value is different
--Create a sequenceCreatesequence Seq_noincrement by TenStart with -Cache -Select * fromDept--inserting data using department sequencesInsert intoDeptValues(Seq_no.nextval,'Develop A','Earth')--Query SequenceSelectSeq_no.currval fromDual
Oracle 4: View