What is a view? is View updatable?

Answer Posted / suraj

-- Views are updatable regardless of the number of
tables involved in that view.
-- Data contained in the base tables are updated when
VIEWS are updated.



drop table t1
drop table t2
drop view t1t2

create table t1(ID int, FirstName varchar(20))
create table t2(ID int, LastName varchar(20))

insert t1 values(1,'John')
insert t1 values(2,'Mike')
insert t2 values(1,'Smith')
insert t2 values(2,'Shres')

create view t1t2
as
select t1.FirstName, t2.LastName
from t1 inner join t2 on t1.ID=t2.ID


update t1t2
set FirstName='Steve' where LastName='Smith'


select * from t1t2
select * from t1

Is This Answer Correct ?    12 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to store and query spatial data?

556


How to change the ownership of a schema in ms sql server?

552


Why do we partition data?

611


Give some Scenario for Non Clusterd index? Can we write system defined functions in side The Function? Wat is the Unique Datatype?

2080


How do you start single user mode in clustered installations?

513






What do you mean by subquery?

577


What is the difference between mysql and sql server?

467


What is coalesce and check constraint in sql server?

537


What happens if strings are casted into wrong code pages in ms sql server?

562


Differentiate between SQL and ORACLE joins and write their syntax.

582


Where is trigger in sql server?

532


What is nonclustered index with included columns ?

544


What is 2nf in normalization?

529


What is ms sql server index?

559


Why transaction is important?

557