w3d3 Flashcards
summary data may not be used
in a where clause of a select(because it exists nowhere)
a view with summary data cannot
be joined with a base table or view(they are different things)
can use any data or view as the project of a select as long as
it doesn’t have summary data in it
updates to base tables
are immediately reflected in all views that encompass them
the only views that can be used for updating are
views of individual records from a single base table
the viewed table is updateable if and only if
the is updateable
CHECK OPTION
only applicable to updateable views
prohibits rows from migrating out of view
LOCAL CHECK OPTION
any inserts or updates to data in this view or other views derived from this view must not cause the row to dissappear from this view unless it dissappears in the table or view this view derives from
CASCADED CHECK OPTOIN
(default)
Any INSERTS or UPDATES to data in this view or other updates derived from this view must not cause the row to dissappear from this view
advantages of views
data independence, improved security, reduced complexity, customization
disadvantages of views
Update restriction (on complex views, still need single table views for updating)
Lack of updateability of view restricitons(need to drop and recreate)
performace (views are virtual and need to be created dynamically via queries unless materialized)
use views for user queries because
it limits access to data on a need to know basis
to remove the need to do a join at the application level
to isolate users to changes at the actual database level
use views for commonly used queries
to allow users to easily get the results they need
it is more efficient to have predefined views than to perform an ad hoc query