Database Note 7: The role of the view

Source: Internet
Author: User

1th:
using views, you can customize user data to focus on specific data.

Explanation:
in the actual process, the company has a different role of staff, we take the sales company, for example,
The purchaser may need some data related to him , and the data unrelated to him is not
have any meaning, we can, based on this fact, specifically create a view for the purchaser
figure, when he is querying the data, just select * from View_caigou is OK.

2nd: Using views, you can simplify data manipulation.

Explanation: When we use queries, we often use aggregate functions and
displays information for other fields and may also need to be associated with other tables, where the written statement may
will be very long, if this action happens frequently, we can create the view, and after that, I
We just need select * from View1 can ~, is not very convenient AH ~

3rd: Using views, the data in the base table has a certain degree of security

because the view is virtual and physically nonexistent, just a collection of data is stored and we can
The base table will have important field information that can not be passed to the user by view, the view is a set of dynamic Data
data is updated as the base table is updated. At the same time, the user view, can not be arbitrarily changed
and delete, can guarantee the security of the data.

4th: You can merge detached data to create a partitioned view

with the development of the society, the company's business volume continues to expand, a large company, subordinates have a very
many branches, in order to manage the convenience, we need a unified table structure, regular view of the company's business
situation, and it is inconvenient to look at the data of each company separately, and there is no good comparability if these
data Merge into a table, it's much easier, then we can use the Union keyword,
merge data from each branch into one view.

The above, is what I think of the role of views, in fact, many companies use views to query data.

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.