Categories: SQL Tutorials

Complex View in SQL with Example | Complex View Examples

In my previous article i have given the difference between simple view and complex view in SQL. In this article i would like to throw light on what is mean by complex view in SQL and what are its different examples. If you faced the interviews like SQL interviews you faced this question about what is mean by complex view in SQL.

What will you find in this article?

1.What is mean by view in SQL and its types?

2.What is Complex view in SQL with real example.

What is view in SQL?

The view is nothing but the snapshot of the database. If we want specific data from single table or multiple tables which needs to be used again and again then the views are useful. You can say in simple words view in SQL is nothing but the logical table created from one or more tables. There are multiple usages of views in SQL like reporting purpose or if we want to fetch the logical data from multiple table again and again then we can create the view.

View in SQL

There are two types of views in SQL :

  1. Simple view : When the view is been created on View in SQL
  2. Complex view : When the view is been created on multiple tables then it is called as complex view.
  3. Materialized view : The materialized view is view like a physical table which is used mainly for performance management.

What is Complex view in SQL with real example?

In this section I would like to explain about complex view in SQL with real life example.

  1. Complex view is view which uses multiple data together and create the snapshot of the data.
  2. Relation between table : The relation between multiple table is must to create the complex views.
  3. Complex view is nothing but the view which has been created with multiple joins, group by statements or set operators to fetch the complex data from multiple tables.
  4. The complex views are used to fetch the complex operations to fetch the complex data from multiple table.

Real life example of Complex view in SQL :

If there are two tables Customer table and Items table and I want to prepare the report where Customer bought the items .

1.Customer :-Customer_name, Customer_num, Customer_code columns

2.Item:-Customer_code,Item_code,Item_name,Item_category columns

We need to create view where we want to show the associated Items to Customer.Here We need to use complex join.

Create view V_Customer

as Select e.Customer_name,d.Item_name

from Customer e,Item d

where e.Customer_code=d.customer_code

Group by item_category;

The above view will give you the details about the Customer_name and associated item with customer group by the item category. So this kind of view is called as complex view.

Amit S

Oracle Consultant with vast experience in Oracle BI and PL/SQL Development. Amiet is the admin head of this website who contributes by preparing tutorials and articles related to database technologies. He is responsible to manage the content and front-end of the website.

Recent Posts

What is Root Cause Analysis (RCA) With real examples

In my previous article I have given details about application support engineer day to day…

4 weeks ago

Application Support Engineer Day to day responsibilities

In my previous articles I have given the roles and responsibilities of L1,L2 and L3…

4 weeks ago

What is mean by SLA ( Service Level Agreement) with Examples?

In my previous articles i have given the hierarchy of production support in real company…

1 month ago

What is Production support Hierarchy in organization?

In this article i would like to provide information about production support organization structure or…

1 month ago

What are roles and responsibilities for L3 Support Engineer?

In my previous article I have given roles for L1 and L2 support engineer with…

1 month ago

What are roles and responsibilities of L2 Engineer?

I have started this new series of how to become application support engineer. This article…

1 month ago