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
How to store and query spatial data?
How to change the ownership of a schema in ms sql server?
Why do we partition data?
Give some Scenario for Non Clusterd index? Can we write system defined functions in side The Function? Wat is the Unique Datatype?
How do you start single user mode in clustered installations?
What do you mean by subquery?
What is the difference between mysql and sql server?
What is coalesce and check constraint in sql server?
What happens if strings are casted into wrong code pages in ms sql server?
Differentiate between SQL and ORACLE joins and write their syntax.
Where is trigger in sql server?
What is nonclustered index with included columns ?
What is 2nf in normalization?
What is ms sql server index?
Why transaction is important?