A
view is a virtual table. A view has no independent physical
existence. The view’s definition exists only in the database’s metadata, but
the data comes from the table or tables from which you derive the view.
A
view is the result set of a stored
query on the data in which the database users can query just as they would in a
persistent database collection object.
This pre-established query command is
kept in the database dictionary. Unlike ordinary base tables in a relational
database, a view does not form part of the physical schema: as a result set, it
is a virtual table computed or collated dynamically from data in the database
when access to that view is requested. Changes applied to the data in a
relevant underlying table are reflected in the data shown in subsequent
invocations of the view.
Advantages of View:-
·
Views
can represent a subset of the data contained in a table. Consequently, a view
can limit the degree of exposure of the underlying tables to the outer world: a
given user may have permission to query the view, while denied access to the
rest of the base table.
·
Views
can join and simplify multiple tables into a single virtual table.
·
Views
can act as aggregated tables, where the database engine aggregates data (Sum, Average etc.) and
presents the calculated results as part of the data.
·
Views
can hide the complexity of data.
·
Views
take very little space to store; the database contains only the definition of a
view, not a copy of all the data that it presents.
·
Depending
on the SQL engine
used, views can provide extra security.
Basically there are two
Views regarding to DBMS.
1.
Updatable View
2.
Non-updatable views
Difference between updatable and non-updatable
views:
Database practitioners can define views as
non-updatable or updatable. If the database system can determine the reverse
mapping from the view schema to the schema of the underlying base tables, then
the view is updatable.
INSERT, UPDATE, and DELETE operations can be performed on updatable views.
Read-only views do not support such operations because
the DBMS cannot map the changes to the underlying base tables. A view update is
done by key preservation.
No comments:
Post a Comment