SQL View


Prev Tutorial Next Tutorial

SQL View

View is a a logical database object, which contains the logical representation of data. In a simple word View is the logical or virtual table.

Once you perform DML operation of view table the same operation automatically reflected to corresponding base table and vice-versa.

alias

Note: Once you drop the base table the corresponding view will not be drop, but it will become invalid.

When view become Invalid ?

View will become invalid in three cases,

  • Drop the base table.
  • When the change the table name.
  • When we modify the structure of the base table.

Syntax

CREATE VIEW view_name as SELECT * FROM table_name;

Drop a View

Syntax

DROP VIEW view_name

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements