View View

A view is a visual table based on the result set of an SQL statement.

Views also contain rows and columns. All fields in the view are a combination of one or more underlying tables. Statements such as where, join, and functions can be added like ordinary SQL statements, and the table structure in the underlying table will not be affected by view changes.

Creation of the view:

CREATE VIEW view_name AS
SELECT field name 1, field name 2
FROM table name
WHERE condition

 When the application is used, the view is the same as the ordinary table, and also corresponds to the entity class.

Benefits of Views:

       Simplifies the user's operation, and the user does not need to care about the relationship between complex tables, but only needs to pay attention to the results of the view query;

       The underlying table structure is hidden, so it can provide protection for confidential data;

       Provides a certain degree of logical independence for reorganizing the database. If a field is to be added to the underlying table, it is not shadowed to the view;

       By adding query conditions, different users can query different data.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327098356&siteId=291194637