What Is View

A view is a logical table based on a table or another view. A view contains no data of its own but is like a window through which data from tables can be viewed or changed. The tables on which a view is based are called base tables. The view is stored as a SELECT statement in the data dictionary. You can create view by using sql create view statement :

create view stu_name as
select roll_no, first_name
from students
where first_name='JOHN';
view created 

This command create a new view called stu_name. Note that this command does not result in anything being actually stored in the database at all except for a data dictionary entry that defines this view. This means that every time you query this view, Oracle has to go out and execute the view and query the database data. We can query the view like this

select * from stu_name
where roll_no between 10 AND 25;

Advantage of using Views:-
  • Views restrict access to the data because the view can display selective columns from the table.
  • Views can be used to make simple queries to retrieve the results of complicated queries
  • Views provide groups of users access to data according to their particular criteria

Related Post :-

People who read this post also read :



0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More