Views Views are known as logical tables. They represent the data of one of more tables. A view derives its data from the tables on which it is based. These tables are called base tables. Views can be based on actual tables or another view also. Whatever DML operations you performed on a view they actually affect the base table of the view. You can treat views same as any other table. You can Query, Insert, Update and delete from views, just as any other table. Views are very powerful and handy since they can be treated just like any other table but do not occupy the space of a table. The following sections explain how to create, replace, and drop views using SQL commands. Creating Views Suppose we have EMP and DEPT table. 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,d.loc From emp e, dept d where e.deptno=d.deptno; So everytime we want to see emp details and department names wher...
Comments