0% found this document useful (0 votes)
41 views3 pages

SQL Notes Part 11

A view is a virtual table that is based on the result set of an SQL statement. Views can be used to simplify complex database schemas, implement row and column level security, and present aggregated data while hiding detailed data. Views are created using the CREATE VIEW statement and queried like tables but do not store data themselves.

Uploaded by

Rang Goud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views3 pages

SQL Notes Part 11

A view is a virtual table that is based on the result set of an SQL statement. Views can be used to simplify complex database schemas, implement row and column level security, and present aggregated data while hiding detailed data. Views are created using the CREATE VIEW statement and queried like tables but do not store data themselves.

Uploaded by

Rang Goud
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

A) -->view is database object. view is nothing but a virtual table.

--->it is saved on the sql quaries.

--->views are does not store data.

advantages:

---> views can be used to reduce complexity of the database schema.

--->views can be used to row and column level security.

----> views can be used to present aggregated data and hide the detailed data.

create a view:

create view view name

As

query

Drop a view:

drop view viewname

example :

create table tb1

id int,

name varchar(25),

address varchar(100)

insert into tb1 values (1,'raju','gnt')

insert into tb1 values (2,'ramu','hyd')


insert into tb1 values (3,'raghu','viz')

id name address

1 raju gnt

2 ramu hyd

3 raghu viz

create view view123

as

select * from tb1

insert into view123 value (4,'vamsi','ppm')

select * from view123

id name address

1 raju gnt

2 ramu hyd

3 raghu viz

4 vamsi ppm

update view123 set name='naidu' where id=4

select * from view123

id name address

1 raju gnt

2 ramu hyd

3 raghu viz

4 naidu ppm
delete from view123 from id=4

select * from view123

id name address

1 raju gnt

2 ramu hyd

3 raghu viz

You might also like