Views provide a means to present a different representation of the data that resides within the base tables. Views are very powerful because they let you tailor the presentation of data to different types of users. Views are often used to:
Provide an additional level of table security by restricting access to a
predetermined set of rows or columns of a table For example, Figure 5–5 shows how the STAFF view does not show the salary or commission_pct columns of the base table employees.
predetermined set of rows or columns of a table For example, Figure 5–5 shows how the STAFF view does not show the salary or commission_pct columns of the base table employees.
Hide data complexity
For example, a single view can be defined with a join, which is a collection of related columns or rows in multiple tables. However, the view hides the fact that this information actually originates from several tables.
For example, a single view can be defined with a join, which is a collection of related columns or rows in multiple tables. However, the view hides the fact that this information actually originates from several tables.
Simplify statements for the user
For example, views allow users to select information from multiple tables without actually knowing how to perform a join.
For example, views allow users to select information from multiple tables without actually knowing how to perform a join.
Present the data in a different perspective from that of the base table
For example, the columns of a view can be renamed without affecting the tables
on which the view is based.
For example, the columns of a view can be renamed without affecting the tables
on which the view is based.
Isolate applications from changes in definitions of base tables
For example, if a view’s defining query references three columns of a four column table, and a fifth column is added to the table, then the view’s definition is not affected, and all applications using the view are not affected.
For example, if a view’s defining query references three columns of a four column table, and a fifth column is added to the table, then the view’s definition is not affected, and all applications using the view are not affected.
Express a query that cannot be expressed without using a view
For example, a view can be defined that joins a GROUP BY view with a table, or a view can be defined that joins a UNION view with a table.
For example, a view can be defined that joins a GROUP BY view with a table, or a view can be defined that joins a UNION view with a table.
Save complex queries
For example, a query can perform extensive calculations with table information. By saving this query as a view, you can perform the calculations each time the view is queried.
For example, a query can perform extensive calculations with table information. By saving this query as a view, you can perform the calculations each time the view is queried.
No comments:
Post a Comment