GeekInterview.com
Series: Subject: Topic:
Question: 238 of 250

What are the advantages of views

Asked by: Interview Candidate | Asked on: Jul 9th, 2005
Showing Answers 1 - 6 of 6 Answers
soccer_champ

Answered On : Jun 18th, 2005

Views provide many advantages, like: 
 
(a) They restrict access to the whole data, because they display only selective columns. 
(b) They can be used to make complex queries easy. A user can use a simple query on a view to display data from multiple tables, without having the knowledge of how to join tables in queries. 
(c) Different views can be created from the same data as per the requirements of different types of use groups.

Yes  1 User has rated as useful.
  
Login to rate this answer.
Dan

Answered On : Jul 9th, 2005

Security 
l Query Simplification 
l Allows Different Perspective 
l Schema Transparency / Location Transparency 
l Schema Consistency 
l Allows work-around for SQL limitations 
 
Security 
to provide an additional level of table security by restricting access to a 
predetermined set of rows and/or columns of a table 
CREATE VIEW emp_sal_hist_v 
AS 
SELECT ratehist.employee, ratehist.beg_date, ratehist.pay_rate 
FROM ratehist, employee 
WHERE ratehist.company = employee.company 
AND ratehist.employee = employee.employee 
AND USER = employee.user_id; 
 
Query Simplification 
 
For example, a single view might be defined with a join, which is a collection of related columns or rows in multiple tables. However, the view hides the fact that this information actually originates from several tables. Saving of complex queries also permits simplified commands for an end-user who does not know how to make joins and/or cryptic business rules governing a join. 
 
Allows Different Perspective 
 
For example, the columns of a view can be renamed without affecting the tables on which the view is based. 
 
Columns cannot be dropped from tables in version 7.x, but you could recreate views without the unnecessary column. 
 
Schema Transparency / Location Transparency 
 
Ability to hide the schema of data from the application, and therefore the user. 
 
For example, if a view's defining query references three columns of a four column table and a fifth column is added to the table, the view's definition is not affected and all applications using the view are not affected. 
 
Views can also be used to join tables across database schemas OR across databases (using remote links), thereby encapsulating schema names from the end user. 
 
Schema Consistency 
 
If a web application is accessing legacy data and then we migrate over to a new system. 
 
Identify legacy tables accessed through the web. 
 
Create a view look-alike for each legacy table and have it return the samedata. 
 
Though not a long-term solution, will allow intermediate means of allowing the web application to run while the interface is rebuilt to the new system. 
 
this is all about advantages of view.  
 
Regards, 
Dan

Yes  1 User has rated as useful.
  
Login to rate this answer.
Aruna Bhamidipati

Answered On : Sep 14th, 2005

1. Provide additional level of table security by restricting access to a predetermined set of rows or columns of a table.
2. Hide Data complexity: For example, a single view might be defined with a join, which is a collection of related columns or rows in multiple tables. However, the view hides the fact that this information actually originates from several tables.
3. Simplify Statements for User: Views allow users to select information from multiple tables without actually knowing how to perform join.
4. Present Data in different perspective: Columns of views can be renamed without effecting the tables on which the views are based.
5. Isolate applications from changes in definitions of base tables. If a view is referencing three columns of a four columns table, if a fifth column is added or fourth column is changed, the view and associated applications are un-affected.
6. Express query that cannot be expressed without using a view. For example, a view can be defined that joins a group by view with a table or a view can be defined that joins a UNION view with a table.
7. Saving of complex queries.

Yes  2 Users have rated as useful.
  
Login to rate this answer.
Dharma Kotha

Answered On : Oct 10th, 2011

View all answers by Dharma Kotha

Views are the logical structures in oracle database and not to interrupt database for every query.

  
Login to rate this answer.
ROHAN MAKODE

Answered On : Feb 25th, 2012

Assume that the dba is modifying a tables and the same time developer want to use that database a then dba can provide him the view for that tables.

Code
  1. CREATE VIEW VIEW_NAME(SELECT * FROM A);

  
Login to rate this answer.
doc123

Answered On : Mar 22nd, 2012

View all answers by doc123

Exactly View is logical identity.Oracle only stores definition of View in metadata. Using view, we can hide some columns of tables from users, we can hide original table name from user. Using view we can perform complex query in single statement.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.