Megan Taylor

front-end dev, volunteacher, news & data junkie, bibliophile, Flyers fan, sci-fi geek and kitteh servant

Intro to Databases: Views, View Modifications – Introduction

Querying views
Once V defined, can reference V like any table
Queries involving V rewritten to use base tables

Modifying Views
Once V defined, can we modify V like any table?
Doesn’t make sense: V is not stored
Has to make sense: Views are some users’ entire ‘view’ of the database

Solution: Modifications to V rewritten to modify base tables

R(A, B) -> (1, 2)
V = Select A from R (1)
user says insert (3)
What would R.B be?

1. Rewriting process specified explicitly by view creator (INSTEAD-OF trigger)
+ Can handle all modifications
– No guarantee of correctness

2. Restrict views and modifications to that translation to base table modifications is meaningful and unambiguous (SQL standard)
+ No user intervention
– Restrictions are significant

December 2, 2011 | Comments Off on Intro to Databases: Views, View Modifications – Introduction | Categories: Posts | Permalink

Comments are closed.

%d bloggers like this: