Untitled

mail@pastecode.io avatar
unknown
plain_text
20 days ago
1.6 kB
10
Indexable
Never
05-02-2024
---------------------------------------------------------------------------------
View:
view is virtual table .
view conatains rows and column.
we can create view by selecting rows from one or more table.

synatx : create view view_name as
select columns from tablename.

select * from manager;
create  view managerview as
select * from manager;
select * from managerview;
select * from employee1;
create  view empview as
select * from employee1;
---------------------------------------------------------------------
when we create view in some condition

create  view manview1 as
select * from manager where city="pune";

select * from manview1


for delete the view 
syntax: drop view viewname;
drop view manview1;
-------------------------------------------------------------------
create view of specific column from table 

create  view manview1 as
select name,salary from manager ;
insert into  manager values(6,"nikita",34,50000,"nanded");
select * from manager;
select * from manview1;

-----------------------------------------------------------------------
create view from multiple table

create view detailview1 as
select c.first_name,c.customer_id, o.item ,o.order_id
from customers  as c,orders as o
where c.customer_id=o.customer_id


---------------------------------
view update

syntax:- create or replace view view_name as
select columns from tablename.
example:-
create or replace view manview1 as
select * from manager;

create or replace view  manview1 as
select * from manager
where city="nagpur";
Leave a Comment