Concepts of views

Source: Internet
Author: User
Tags definition modify query
Concept | view


A view is a transformation of the original database data and is another way to view the data in the table

Way. A view can be viewed as a moving window through which you can see the interesting

Data.

Views are obtained from one or more actual tables, where data is stored in the data

Library. The table that is used to produce the view is called the base table for the view. A view can also be from the

Generated in another view.

The definition of the view exists in the database, and the data associated with the definition does not save another

In the database. The data you see through the view is stored in the base table.

The view looks very much like the physical table of the database, and it operates with any other table

The same. When you modify data through a view, you are actually changing the data in the base table;

, changes to the base table data are also automatically reflected in the view produced by the base table. Due to logical

, some views can modify the corresponding base table, and some cannot (only query).



The function of the two views

* Simple nature. What you see is what you need. Views can not only simplify the user's understanding of the data

Solution, they can also simplify their operations. The queries that are frequently used can be defined as views,

This allows the user not to specify all the conditions for each subsequent operation.

Security Users can only query and modify the data they can see through the view. Number

According to other data in the library, it is neither visible nor removed. Database authorization commands enable each to use the

The user's retrieval of the database is restricted to a specific database object, but cannot be authorized to the database special

Fixed row and on a specific column. With views, users can be limited to different subsets of data:

Use permissions can be limited to a subset of the rows of a 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 by the connections of multiple base tables.

Use permissions can be limited to the statistical summary of the data in the base table.

Permissions can be restricted to a subset of another view, or some views and base tables

On the merged subset.

* Logical data Independence. Views help users to mask the impact of real-world table structure changes.



Security for three views

The security of a view prevents unauthorized users from viewing a particular row or column, and is a user who can only

See the specific rows in the table as follows:

1 Add a column in the table that flags the user name;

2 The view is established, the user can only see the line marked with their own user name;

3 Authorize the view to other users.



Four logical data Independence

Views allow applications and database tables to be isolated to some degree. If there is no view,

The application must be based on the table. With the view, the program can be built on top of the view,

The program is separated from the database table by the view. Views can enable programs in the following ways

Independent of data:

1 if the application is based on the database table, when the database table is changed, you can

The view is set up and the view masks the changes in the table so that the application can not move.

2 If the application is based on the database table, when the application changes, you can build on the table

Vertical view, through the view mask application changes, so that the database table does not move.

3 If the application is based on the view, when the database table is changed, you can fix it on the table

Change the view to mask the changes in the table so that the application can not move.

4 If the application is based on the view, when the application changes, you can modify the view on the table

Diagram, through the view mask application changes so that the database can not move.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.