Create View

 

VIEWS

A view is a logical or virtual table, which does not, exists physically in the database.

Views are also called as Dictionary Objects.

 

Advantages

Security – The confidential columns can be suppressed from viewing and manipulation.

Complexity can be avoided.

Logical columns can be created.

Application design becomes easier.

 

 

Views can be classified into two categories on the way they are created.

1. Simple View            2. Complex View

 

Simple View

If the view is created from a single table, it is called as a simple view. We can do

DML Operation, if it is Simple View.

 

Complex View

If the view is created on multiple tables, it is called as a complex view.

 

Syntax

CREATE [OR REPLACE] VIEW <view name>

A5 <query>

 

Example 1

CREATE OR REPLACE VIEW data_emp

AS

SELECT ename, salary FROM Employee;

 

Example 2

CREATE OR REPLACE VIEW dup_emp

AS

SELECT ename, salary, salary*0.2 comm FROM Employee

 

 

DROPPING A VIEW

Only the owner of the view can drop it.

Syntax

DROP VIEW <view name>;

 

Example

DROP VIEW  data_emp;

 

 

 

 

Registration


A password will be e-mailed to you.

Feedback Form

Name (required)

Email (required)

Feedback