01-02-2013, 03:20 PM
VIEWS
VIEWS.docx (Size: 19.66 KB / Downloads: 18)
A View is a virtual relation that does not necessarily exist in the database but can be produced upon request by a particular user, at the time of request.
CREATING A VIEW:
The format of the CREATE VIEW statement is,
CREATE VIEW viewcolumn [(newcolumn name [,…])] AS subselect [WITH[CASCADE/LOCAL]CHECK OPTION]
The subselect are known as the defining query. If WITH CHECK option is specified, SQL ensures that if a row fails to satisfy the where clause of the given query of the view, It is not added to the underlying base table of the view.
REMOVING A VIEW:
A view is removed from the database with the DROP VIEW statement.
SYNTAX:
DROP VIEW viewname [RESTRICT/CASCADE]
If CASCADE is specified, DROP VIEW deletes all related dependent objects, all objects that reference the view.
If RESTRICT is specified and there are any other objects that depend for their existence on the continued existence of the view being dropped, the command is rejected. The default setting is RESTRICT.
A horizontal view restricts a user’s access to selected rows of one or more tables. A vertical view restricts a user’s access to selected columns of one or more tables.
UPDATABLE VIEW:
For a view to be updatable, the DBMS must be able to trace any row or column back to its row or column in the source table.
RESULT
Thus the views was studied and executed in RDBMS