View is the dynamic result of one or more relational operations operating on the base relations to produce another relation. A view does not contain any data, rather a view is defined as a query on one or more base relations and a query on the view is translated into a query on the associated base relations.
Why do we need views? When are they useful?
Views are needed and useful because they can create a virtual relation based on our request at time of request, even though the virtual relation does not necessarily actually exist in the database. Views also permit us to access data in a customized way, so that same data can be seen by different users in different ways, at the same time. Besides, we can use views to simplify complex operation on base relations.
When should we avoid using them?
We should avoid using Views:
- If we want to update views involving multiple base relations and aggregation or grouping operation.
A relational database is a set of tables (sometimes called relations) containing one or more data categories in columns. Each row contains a unique instance of data for the categories defined by the columns.
* Accessibility: ad hoc data access using query languages means that queries can be automatically compiled, executed, and optimized without resorting to programming
* Correctness: the semantics of the relational algebra are sound and complete
* Flexibility: the relational model separates the logical from the physical model and this decoupling increases flexibility
* Integrity: constraints helpful in ensuring that structural changes did not adversely effect the meaning of the database
* Predictability: the consistent semantics enables users to easily anticipate the result of a given query
* Multiple views: it is straightforward to present different user groups different views of the same database
* Provide concurrency control (checked by referential key) and transaction management (checked by transaction key)
* Backup and Recovery are more convenient
* Provide more security
In addition to being relatively easy to create and access, a relational database has the important advantage of being easy to extend. After the original database creation, a new data category can be added without requiring that all existing applications be modified.
3.5 What is a view? Discuss the difference between a view and a base relation. Explain what happens when a user accesses a database through a view.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment