The view is a transformation of the original database data, which is another kind of to view the data in the table.
the way. You can view the view as a moving window, you can see interested
data.
The view is obtained from one or more actual tables, and the data of these tables is stored in data.
In the library. Those tables for generating a view are called the base table of the view. One view can also be from
Another view is generated.
The definition of the view exists in the database, and the data related to this definition does not have a copy.
In the database. Store in the base table through the data viewed by the view.
The view looks very similar to the physical table of the database, the same for it with any other table.
same. When modifying the data through the view, it is actually changing the data in the base table;
In terms of base table data, the change is automatically reflected in the view generated by the base Table. Due to logic
The reason, some views can modify the corresponding base table, and some cannot (only query).
Two view
* Simpality. It is desirable to see it. View not only simplifies the user's information
Solution, you can simplify their operations. Those queries that are often used can be defined as a view.
Thus, the user does not have to specify all of the conditions each time.
* safety. You can only query and modify the data they can see by view users. number
According to other data in the library, they can't see it. The database authorization command can make each
The retrieval of the database is limited to a specific database object, but cannot authorize the database.
Dedicated and specific columns. Through view, the user can be limited to different subset of data:
Use rights can be limited to the subset of rows of the base table.
Use rights can be restricted to the subset of the columns of the base table.
Use rights can be limited to the subset of the rows and columns of the base table.
Use rights can be limited to a line defined in a connection of multiple base tables.
Use rights can be restricted in the statistical summary of data in the base table.
Use rights can be restricted to a subset of another view, or some views and base tables
The merged subset.
* Logic data independence. The view helps the user to block the impact of the real surface structure.
Safety of three views
The security of the view prevents unauthorized users from viewing specific rows or columns, which can only
Seeing the specific row in the table is as follows:
1 Add a column of a logo username in the table;
2 Establish a view, it is only the line marked with his own username;
3 Authority authorize to other users.
Four logic data independence
A view allows applications and database tables to a certain extent. If there is no view,
Application must be built on the table. After having a view, the program can be built on top of the view.
So the program is divided by the view to the view. The view can make the program in the following aspects
Independence with data:
1 If the application is built on the database table, you can play at the table when the database table changes
Establish a view, through the change of the view shielding table, so the application can not move.
2 If the application is built on the database table, you can build on the table when the application changes
Viewing the view, through the change of the application, so that the database table is not moving.
3 If the application is built on the view, when the database table changes, you can repair it on the table.
Change the view, through the change of the view shielding table, so the application can not move.
4 If the application is built on the view, you can modify it on the table when the application changes.
Figure, through the view shielding the application, so that the database can not move.