Home  >  Article  >  Daily Programming  >  What does mysql data table view mean? What are the uses? (Pictures + Videos)

What does mysql data table view mean? What are the uses? (Pictures + Videos)

藏色散人
藏色散人Original
2018-10-25 15:18:126750browse

This article mainly gives you a brief introduction to mysql data table view and its function.

View is view. The view here is obviously not the same concept as the view in our common MVC framework.

In our mysql database, "view" is a computer database terminology, which is a virtual table.

So how to understand virtual tables? What's the use?

For some novices, they may not be able to understand it for a while.

Let’s give you a detailed explanation of mysql data table view with a simple example!

Virtual table, as the name suggests, is a virtual table. Everyone should know that the basic data table in mysql is composed of three parts: the table name, the fields in the table, and the records of the table. . And these table structures really take up memory.

In fact, the view is a virtual table. Like the basic data table, it also contains a series of named column and row data. However, the view does not exist as a stored set of data values ​​in the database. In layman's terms, a view is a visual table based on the result set of a SQL statement. It has no actual physical records, that is, it does not occupy physical storage space!

So when we need to perform complex join multi-table queries, if we have to write a single SQL statement every time to query the tables one by one, such an operation will obviously make the efficiency very low.

The existence of the view function will solve this problem very well.

For example, if a school needs to hold a basketball game, then each class is equivalent to a table. We need to query the students who know basketball skills from each class. If each class To hold a competition, each table must be queried separately, which will take up a lot of resources and be very inefficient.

What does mysql data table view mean? What are the uses? (Pictures + Videos)

At this time, we can put all the table data that meets the query requirements into one view, because the view does not occupy resources, so every time a competition is held , you can directly call the data in the query view. This is also an important role of views.

Finally, I will give you a brief introduction to some connections between views and mysql basic data tables.

A view is a virtual table based on the MySQL basic table. Its structure and content come from the basic table. A view can correspond to one basic table or multiple basic tables. Views depend on the existence of basic tables.

This article is about the definition and function of mysql data table view. It is also very easy to understand. I hope it will be helpful to friends who need it!

If you want to know more about mysql, you can follow the PHP Chinese website mysql video tutorial, everyone is welcome to refer to and learn!

The above is the detailed content of What does mysql data table view mean? What are the uses? (Pictures + Videos). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn