Differences between views and tables

Source: Internet
Author: User

1. A view is a specific subset of database data. You can prohibit all users from accessing database tables, but require users to operate data only through views. This method can protect users and applications from modifying some databases. 2. The view is abstract. When used, the view extracts data from the table to form a virtual table. However, there are many restrictions on his operations.
3. The view will never disappear unless you delete it.
Views sometimes help improve efficiency. Temporary tables are almost non-helpful for performance and resource consumers.
Views are usually placed together with the data stock, and temporary tables are always in tempdb.
4. The view is suitable for multi-table join browsing! It is not suitable for adding, deleting, and modifying. The stored procedure is suitable for SQL statements that are frequently used, which can improve execution efficiency!


Differences and relationships between views and tables

Difference: 1. views are compiled SQL statements. The table is not
2. The view does not have actual physical records. But tables have.
3. The table is the content and the view is the window.
4. A table uses only physical space, while a view does not occupy physical space. A view only has a logical concept. A table can be modified in time, but only created statements can be used to modify the view.
5. The table is in the internal mode and the view is in the external mode.
6. view is a way to view data tables. You can query data composed of certain fields in a data table, but only a set of SQL statements. In terms of security, a view can give users no access to data tables, so that they do not know the table structure.
7. A table is a table in global mode and a real table. A view is a table in local mode and a virtual table.
8. Creating and deleting a view only affects the view and does not affect the corresponding basic table.

Link: A view is a table created on top of a basic table. Its structure (that is, the defined column) and content (that is, all data rows) come from the basic table, it exists based on the basic table. A view can correspond to one basic table or multiple basic tables. A view is the abstraction of a basic table and the new relationship established in a logical sense.

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.