Get free ebooK with 50 must do coding Question for Product Based Companies solved
Fill the details & get ebook over email
Thank You!
We have sent the Ebook on 50 Must Do Coding Questions for Product Based Companies Solved over your email. All the best!

What is view and types of view in DBMS?

In this article, we will study what does view in dbms do and how to get view of data in dbms. Apart from this, we will be looking at the different types of view available to the user in dbms and before signing off, some of the frequently asked questions related to vew of data in dbms will be addressed.

View in DBMS

View in dbms are virtual table obtained as a result of a query in SQL i.e. Structured Query Language. Whenever the end-user requests the data according to specified needs rather than complete information of the table.

A view is generated to show the information that the user requires instead of the critical part of the schema which must be confidential to the owner. In a manner, the view of data in dbms is shown instead of the entire database. Any changes made to the database will also reflect in the view created.

How to get a view of data in DBMS

View in dbms can be obtained by writing a set of statements that will pick the required parts from the database and create a table with results spread across the table on the user’s device. The pseudocode to get a view of data can be written as:-

create
view view
as
select columnName1, columnName2,...
from tableName
where condition;

Let’s suppose we want to get the data for a student’s performance in a particular subject in the recently held exam. We can get the information view in dbms.

create
view view
select marks from student
where uniqueID = 1221;

Now that we have clarity on how to create a view of data in dbms, we will move forward on how to drop or delete a view in dbms in the upcoming sections of this article on View in DBMS.

Dropping a view in DBMS

In case one needs to get rid of an already generated view, there is an option to terminate the view using the drop command available to us in Structured Query Language (SQL).

Let us look at an example along with the code on how we can drop a view in dbms.

drop view NameView;

Reasons to Use View in DBMS

Views are at advantage as the view of data in dbms is restricted to only a subset of the entire database or in a sense, “Ask as per your requirements” is the principle on which view of data in dbms is based upon.

Another advantage to using View in dbms is that it merges information from multiple tables to show what the user requires.

As they are computing and creating output for the user, they require no additional storage unlike the data stored in the database.

Views are able to present to aggregated data such that for measure purpose, we can get the sum, count and average of values spread over different tuples in schemas.

One of the major reasons to use view is that it provides security and no unauthorized access or bypass can be performed and information services can run as usual.

Conclusion

In this article, we discussed what view in dbms is, how to access them and steps to get a view of data in dbms. In addition to getting the view of data in dbms, we figured out how to delete or drop a view in dbms.

Heading south, we also studied the pros and cons of using view in dbms. By now you must be having a good grip on the topic of view in dbms.

Frequently Asked Questions on View in DBMS

1. Is view related to relational schema?
No, View is used to present the data and in manner is related to relational schema.

2. How to drop a view?

drop view Name_Of_View;

Leave a Reply

Your email address will not be published. Required fields are marked *