View is a transformation of the original database data, and is another way to view the data in the table.
Method. You can think of a view as a moving window, through which you can see
Data.
A view is obtained from one or more actual tables whose data is stored in the data
Library. The tables used to generate a view are called the base tables of the view. A view can also be
Generated in another view.
The view definition exists in the database, and the data related to this definition is not saved again
In the database. The data displayed in the view is stored in the base table.
The view looks like a physical table of a database, and its operations are the same as any other tables.
Same. When data is modified through a view, the data in the base table is actually changed.
The changes to the base table data are automatically reflected in the view generated by the base table. Because of the logic
Some views can modify the corresponding base table, while others cannot (only query ).
Role of two views
* Simplicity. What you see is what you need. A view not only simplifies User Data Management
To simplify their operations. Frequently Used queries can be defined as views,
Therefore, you do not have to specify all the conditions for each subsequent operation.
* Security. Users can only query and modify the data they can see through the view. Quantity
Other data in the database is invisible or not available. Database authorization commands enable
The user's retrieval of the database is restricted to specific database objects, but cannot be authorized to the database feature
Fixed Rows and specific columns. Through views, users can be restricted to different subsets of data:
The permission can be restricted to a subset of rows in the base table.
The permission can be restricted to a subset of columns in the base table.
The permission can be restricted to the row and column subsets of the base table.
The permission can be restricted to the rows restricted by the connection of multiple base tables.
The permission can be restricted to the Statistical Summary of data in the base table.
The permission can be restricted to a subset of another view, or some views and base tables.
The merged subset.
* Logical Data independence. View helps you avoid the impact of changes in the real table structure.
Security of Three Views
View security prevents unauthorized users from viewing specific rows or columns.
The method for viewing specific rows in the table is as follows:
1. Add a column indicating the user name in the table;
2. Create a view. You can only see rows marked with your username;
3. Authorize the view to other users.
4. Logical Data independence
View can make applications and database tables independent to a certain extent. If no view exists,
Applications must be built on tables. With the view, the program can be built on the view,
The program and the database table are separated by the view. View can make the program
Independent from data:
1. If the application is created on a database table and the database table changes, you can
Create a view on, and mask table changes through the view, so that the application can not move.
2. If the application is created on a database table and the application changes, you can create
Creates a view to block application changes so that the database tables do not move.
3. If the application is built on the view, you can modify the table when the database table changes.
Change the view to avoid table changes, so that the application can remain unchanged.
4. If the application is created on the view, you can modify the view on the table when the application changes.
Graph. You can use the view to block application changes so that the database does not move.