Database view
From DocForge
(Difference between revisions)
Matt (Talk | contribs)
(Created page with 'A '''database view''' is a relational database object which can be queried like a database table, but is implemented as a query over actual data tables. Views don't stor…')
Newer edit →
(Created page with 'A '''database view''' is a relational database object which can be queried like a database table, but is implemented as a query over actual data tables. Views don't stor…')
Newer edit →
Revision as of 17:56, 16 March 2010
A database view is a relational database object which can be queried like a database table, but is implemented as a query over actual data tables. Views don't store data but give a tabular view over other database data.
Advantages
- Database views can let software developers reuse complex or often-used queries without rewriting those queries. Stored procedures are another method for abstracting queries.
- The queries underlying a view can be changed without affecting the use of the view.
- A database administrator can choose to replace a table with a view without affecting any applications which rely on that table. Conversely a view can be changed to query different tables with no side affects. One classic example is a view over multiple tables of historical data, where periodically new history tables are created and added to the view which covers all of the data.
Disadvantages
- By abstracting away queries, a developer might not be aware of underlying performance issues. It might be more efficient at times to query an underlying table directly rather than querying the view.

