Advantages and disadvantages of views
In the program design, you must understand the pros and cons of the view, so as to avoid weaknesses, the view has some of the following advantages:
Simplicity. Views not only simplify the user's understanding of the data, they can also simplify their operations. Those queries that are used frequently can be defined as views, so that users do not have to specify all the conditions for subsequent operations each time.
Security Users can only query and modify the data they see through the view. Other data in the database is neither visible nor can be taken. The database Authorization command enables each user to limit the retrieval of a database to a specific database object, but not to a specific row or column on a database. With views, users can be limited to different subsets of the data.
Logical data independence. Views enable applications and database tables to be somewhat independent. If there is no view, the application must be built on the table. With a view, the program can be built on top of the view so that the program is separated from the database table by the view.
The view also has some drawbacks, mainly as follows.
Performance: SQL Server must turn the query of the view into a query for the base table, and if the view is defined by a complex multi-table query, then even a simple query of the view, SQL Server will turn it into a complex combination that takes some time.
Modify limit: When a user attempts to modify some rows of a view, SQL Server must convert it to some row of the base table. This is convenient for simple views, but it can be non-modifiable for more complex views.
Therefore, when defining a database object, you cannot define the view without selecting it, you should weigh the advantages and disadvantages of the view and define the view reasonably.
What are the advantages and disadvantages of using views in SQL