×

DBMS View: Read, Update, Create and Drop

View in DBMS: The View is a logical or virtual table that allows users to view or manipulate parts of the table. View is also a table which consists of rows and columns. Users can easily create the view in the database by selecting the fields from two or more tables in the same database.

Users can also execute the DDL and DML operations on View. Like, the tables, we can also do indexing in views. It is more difficult to normalize the database over the second normal form if views are not used.

Following are some of the advantages of View over database tables:

  • Using Views, we can join multiple tables into a single virtual table.
  • Views hide data complexity.
  • In the database, views take less space than tables for storing data because the database contains only the view definition.
  • Views indicate the subset of that data, which is contained in the tables of the database.

Types of DBMS View

In DBMS, the view can be categorized into the following two types:

1. Read-Only View

2. Updateable View

Read-Only View

It is a type of view that allows users only to access the data of view.

Updateable View

It is a type of view that allows users to access, insert, update or delete the data from the view.

Create the View in RDBMS

We have learned the meaning of the DBMS view. Now, we will discuss how to create a view in SQL. Using the following syntax, any user can easily create the view in SQL:

CREATE VIEW view_name AS
SELECT column1, column2,.....,Column N
FROM name_of_table
WHERE condition;

Now, we will take the following example, which helps us to understand easily.

Example: This example uses the table Employee_Details, which contains three columns Emp_ID, Emp_Name, and Emp_Address.

Emp_IDEmp_NameEmp_Address
101AnujDelhi
102AmanMumbai
103RamGoa
104SatishDelhi
105AbhayMumbai
106AnujDelhi

Emloyee_Details

Now, we create the view as employee_view from the Emloyee_Details table.

CREATE VIEW Employee_View AS
SELECT Emp_Name, Emp_ADDRESS
FROM Employee_Details
WHERE EMP_ID < 104;

If we want to see the data of the view, then we have to type the following query as same as typed for accessing the data of table:

SELECT * FROM Employee_View;
Emp_NameEmp_Address
AnujDelhi
AmanMumbai
RamGoa

Drop the View

If any user wants to delete the view which is created in the database, then that user has to use the following syntax:

DROP VIEW view_name; 

If we want to delete the above view, which is created using the Emoloyee_Details table, then we have to delete this:

DROP VIEW Employee_View;  

Related Topics

Normalization in DBMS: 1NF, 2NF, 3NF, BCNF & 4NF with Examples

Normalization is a technique of organizing the data in the database. It is a systematic approach which is used to remove or reduce data redundancy in the tables and remove the...

7 minutes read.

Query processing in DBMS

Operations on DBMSs are made much simpler, more organized, and methodical with SQL. These are not only simpler for people to comprehend, but after gaining a basic comprehension of them, they...

4 minutes read.

Concurrency Control Protocols

Concurrency Control Protocols Concurrency control protocols ensure the atomicity, serializability and isolation of the concurrent transactions. The Concurrency control protocols can be broadly classified into the following categories: Lock Based ProtocolTimestamp protocol Lock Based Protocol In this protocol,...

5 minutes read.

Conflict Serializability in DBMS

Conflict Serializability A schedule is said to be conflict serializable if it can transform into a serial schedule after swapping of non-conflicting operations. It is a type of serializability that can be used...

3 minutes read.

Components of Relational Database Management System

A relational database management system compromises various component. Tables, records, attributes, instances, schemas and keys together form a relational database. In this page, we will discuss each component of RDBMS in...

4 minutes read.

Domain in DBMS

Constraints: Constraints in DBMS are a set of guidelines that guarantee that authorized users who modify the database do not alter the consistency of the data. Constraints are expressed in DDL...

3 minutes read.

Meta Data in DBMS

Metadata: Metadata is simply described as information about information. It indicates that the data is described as well as its context. It makes data easier to find, interpret, and organize. I'll...

4 minutes read.

DBMS View: Read, Update, Create and Drop

View in DBMS: The View is a logical or virtual table that allows users to view or manipulate parts of the table. View is also a table which consists of...

2 minutes read.

Advantages of RDBMS

The relational database management system collects related data stored in tabular format. The data is stored in rows and columns, where rows usually represent the individual entity of the collected...

6 minutes read.

Difference between DBMS and RDBMS

Database Management System A DBMS is system software which is used to store and manage the data in the database. It was introduced in 1960 for storing the data or information. This system allows...

3 minutes read.

Difference between Relational and Non-Relational Databases

Databases have become an integral part of our lives, from powering big websites like Amazon and Netflix to everyday tasks like remembering our passwords. With such an indispensable role in...

7 minutes read.

DBMS Schedule

A schedule is a process of combining the multiple transactions into one and executing the operations of these transactions in a predefined order. A schedule can have multiple transactions in it, each transaction...

2 minutes read.

ER Diagram for School Management System in DBMS

What is ER Diagram? An ERD, or entity relationship diagram, is a diagram that depicts the connections between a group of entities contained in a database. In other words, ER diagrams...

6 minutes read.

DBMS Joins: Inner, Outer, Natural and Self Join

Joins are the combination of related tuples from the two different relations or tables into a single type. It is similar to the Cartesian product except the fact that in Cartesian product operation,...

4 minutes read.

Redundancy in DBMS

Data redundancy is a situation that is created in the database in which the same amount of data is stored in two different places. The different places are found in a...

3 minutes read.

Inference Rules

Armstrong’s axioms are the complete set of basic inference rules used to infer all the functional dependencies on the relational database. An inference rule is a type of assertion that a user can...

2 minutes read.

DBMS Data Independence: Logical and Physical

Data Independence in DBMS: Data independence is a concept of DBMS which alters the schema of the database at one level of the database system without altering the schema definition...

2 minutes read.

Evaluating DBMS

There are various database management systems available in the market. Each type has its features and can be used for varied purposes. The large number of DBMS makes it difficult...

4 minutes read.

ER Diagram for Banking System in DBMS

Entity Relationship Diagram Entity Relationship Diagrams, or ER Diagrams for short, are diagrams that show the relationships among entity sets that are stored in databases. Alternatively said, ER diagrams assist in...

3 minutes read.

DBMS Architecture

This is the first step when creating a database management system. The architecture of a database management system plays an important role in determining the actual design and layout of...

4 minutes read.