Updating an oracle view safe dating hotlines
Instead of giving this join query again and again, we can create a view on these table by using a CREATE VIEW command given below create view emp_det as select e.empno, e.ename,e.sal,e.deptno,d.dname,from emp e, dept d where e.deptno=d.deptno; Now to see the employee details and department names we don’t have to give a join query, we can just type the following simple query.
select * from emp_det; This will show same result as you have type the long join query.
When you update record(s) in a VIEW, it updates the records in the underlying tables that make up the View.
These conditions must be true before any Specify names for the expressions selected by the defining query of the view.
All operations performed on a view actually affect the base table of the view.
You can use views in almost the same way as tables.
The following sections explain how to create, replace, and drop views using SQL commands. To see the empno, ename, sal, deptno, department name and location we have to give a join query like this.
select e.empno,e.ename,e.sal,e.deptno,d.dname,From emp e, dept d where e.deptno=d.deptno; So everytime we want to see emp details and department names where they are working we have to give a long join query.