Database Concepts-Views

A view is a pre-written query that is stored on the database. A view consists of a SELECT statement, and when you run the view

A view can be useful when there are multiple users with different levels of access, who all need to see portions of the data in the database (but not necessarily all of the data). Views can do the following:

·                     Restrict access to specific rows in a table

·                     Restrict access to specific columns in a table

·                     Join columns from multiple tables and present them as though they are part of a single table

·                     Present aggregate information (such as the results of the COUNT function)

(OR)

A SQL View is a virtual table, which is based on SQL SELECT query. Essentially a view is very close to a real database table (it has columns and rows just like a regular table), except for the fact that the real tables store data, while the views don’t. The view’s data is generated dynamically when the view is referenced. A view references one or more existing database tables or other views.

In effect every view is a filter of the table data referenced in it and this filter can restrict both the columns and the rows of the referenced tables. 

0 comments:

Post a Comment