Home > Database > Mysql Tutorial > body text

The difference between simple views and complex views in SQL

WBOY
Release: 2023-08-26 10:33:13
forward
1152 people have browsed it

SQL 中简单视图和复杂视图的区别

Before discussing simple views and complex views, we should first know what a view is. A view is a logical virtual table created from one or more tables and is primarily used to extract columns from one or more different tables at a time. Depending on the tables involved in the view, we can distinguish between simple views and complex views in SQL.

The following are the important differences between simple views and complex views.

Serial number Keywords Simple view Complex view
1 Definition A simple view is a view that involves only a single table. In other words, in SQL, a simple view has only one base table. On the other hand, a complex view is a view involving multiple tables, that is, multiple tables are projected in the complex view.
2 Association In a simple view, since there is only one table in the context, there is no need to apply a primary association in SQL. On the other hand, in a complex view, since there are multiple tables in the context, general associations need to be applied, including join conditions, grouping conditions, and sorting conditions.
3 Group function In a simple view, since there is only one table, we cannot use grouping functions such as MAX() and COUNT() . On the other hand, in complex views, since there are multiple tables, we can use various grouping functions.
4 Allowed operations In simple view, DML operations can be easily performed. However, in complex views, it is not always possible to perform DML operations.
5 Modification As mentioned above, insertion, deletion and update can be done directly due to DML operations. However, in complex views, we cannot apply insertion, deletion and update.
6 Empty columns In a simple view, you cannot include non-empty columns from the base table. However, in complex views, non-null columns can be included.

The above is the detailed content of The difference between simple views and complex views in SQL. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!