A VIEW is a virtual table in a database whose contents is defined by a query. To the end user the view functions and seems like an actual table with defined columns and rows of data. However these rows and columns are visible by the query results of the view. For most practical purposes views allow an easier understanding of the Database for gathering information, but some DBMS allow views that you can do INSERT, DELETE, and UPDATE statements on.
Main Advantages of Using a VIEW
- Simplification of Queries
As a view is actually a query on the database, it can draw information from multiple different tables. This allows the user the ability to query the single virtual table of the view instead of doing complex joins across multiple tables
- Security of Data
A main concern in database is users access to data. If your database table contains personal or confidential data then you do not want to grant access to it to all users. Instead by use of a view you can grant access to a subset of columns and data keeping the confidential data secure.
Main Disadvantage of a VIEW
- Query Performance
Although a view may appear as a table, the DBMS must still perform the underlying query when a query is executed against the view. If the view is a complicated multiple table query then a simply query of the view still results in a complex join. Which may take a long time to execute.
Comments & Questions
Add Your Comment