A view is a virtual table whose contents are defined by a query. As with a real table, a view contains a series of column and row data with names. However, the view does not exist in the database as a stored set of data values. Row and column data is derived from the table referenced by the query that defines the view, and is generated dynamically when the view is referenced. The view acts like a filter for the underlying table referenced in it. A filter that defines a view can come from one or more tables in the current or other database, or another view view is an SQL statement of a query stored in a database, mainly for two reasons: security reasons, views can hide some data, such as: Social Insurance Fund table, you can use the view to display only names, addresses, Not showing social security numbers and wages, and so on, another reason is that complex queries can be easily understood and used. The function of the view * simplicity. What you see is what you need. Views not only simplify the user's understanding of the data, they can also simplify their operations. Those queries that are used frequently can be defined as views, so that users do not have to specify all the conditions for subsequent operations at a time. Security Users can only query and modify the data they see through the view. Other data in the database is neither visible nor can be taken. The database Authorization command enables each user to limit the retrieval of a database to a specific database object, but not to a specific row or column on a database. With views, users can be limited to different subsets of data: Usage permissions can be limited to subsets of rows in the base table. Use permissions can be limited to a subset of the columns of the base table. Use permissions can be limited to a subset of the rows and columns of the base table. Use permissions can be limited to rows that are qualified for connections to multiple base tables. Usage permissions can be limited to statistical summaries of the data in the base table. Use permissions can be restricted to a subset of another view, or to a subset of the merged views and base tables. * Logical data Independence. Views help users to mask the impact of changes in the real-world table structure.
The role of view view in SQL