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
What is sqlservr.exe - process - sql server (sqlex?press)?
What is equi join with example?
Does windows server 2016 come with sql server?
What is difference between count (*) and count 1?
What is xml datatype?
What are the types of normalization?
You have modified 100 store procedures and want to replicate these changes from development to prodution, and production can have users using the Server/DB, how would you replicate without causing issues?
What are the advantages of having an index on the sql server?
How to find related tables in sql server?
What is the syntax for encrypting a column in SQL Server?
what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration
What is meant by indexing files?
What is exclusive locks?
How to download and install the scaled-down database adventureworkslt?
what types of replication are supported in sql server? : Sql server database administration