Prerequisite – SQL | Views
A View in SQL as a logical subset of data from one or more tables. Views are used to restrict data access. A View contains no data of its own but its like window through which data from tables can be viewed or changed. The table on which a View is based are called BASE Tables.
There are 2 types of Views in SQL: Simple View and Complex View. Simple views can only contain a single base table. Complex views can be constructed on more than one base table. In particular, complex views can contain: join conditions, a group by clause, a order by clause.
The key differences between these types of Views are:
|Simple View||Complex View|
|Contains only one single base table or is created from only one table.||Contains more than one base tables or is created from more than one tables.|
|We cannot use group functions like MAX(), COUNT(), etc.||We can use group functions.|
|Does not contain groups of data.||It can contain groups of data.|
|DML operations could be performed through a simple view.||DML operations could not always be performed through a complex view.|
|INSERT, DELETE and UPDATE are directly possible on a simple view.||We cannot apply INSERT, DELETE and UPDATE on complex view directly.|
|Simple view does not contain group by, distinct, pseudocolumn like rownum, columns defiend by expressions.||It can contain group by, distinct, pseudocolumn like rownum, columns defiend by expressions.|
|Does not include NOT NULL columns from base tables.||NOT NULL columns that are not selected by simple view can be included in complex view.|
View – orafaq
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Difference between View and Cursor in SQL
- Difference between Conflict and View Serializability
- Difference between Simple and Compound Assignment in Java
- What is GAV (Global as View)?
- View Serializability in DBMS Transactions
- Implementation of Materialized view through the Java Program
- Polygraph to check View Serializabilty in DBMS
- Check if Table, View, Trigger, etc present in Oracle
- Program to find Simple Interest and Compound Interest in PL/SQL
- Difference between MP4 and MP3
- Difference between IoE and IoT
- Difference between Hue and Pig
- Difference between LED and LCD
- Difference between GSM and LTE
- Web 1.0, Web 2.0 and Web 3.0 with their difference
- Difference between SSH and SSL
- Difference Between DVD-R and DVD+R
- Difference between LAN and MAN
- What's difference between MMU and MPU?
- Difference between ++*p, *p++ and *++p
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : ManasChhabra2