What is View ?

  • View is a database object which contains the logical representation of data.
  • View can be created on the entire table or particular columns on a table or subset of table.
  • If we apply any DML operations on view, the same operations automatically effected on corresponding base table and vice versa.

How to create view:

Syntax:

Create view <view-name>  as  select  <col-1,col-2,—col-n>  from  <tab-name>

Example:

create view emp_view as select eno, ename from emp

// created view  with name emp_view on emp table with two columns(eno, ename).

  • View is invalid whenever table is dropped and change the structure of table.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s