GeekInterview.com
Series: Subject: Topic:
Question: 106 of 190

What are the advantages and disadvantages of View?

Asked by: sbagai2001 | Member Since May-2006 | Asked on: May 26th, 2006

View all questions by sbagai2001   View all answers by sbagai2001

Editorial / Best Answer

Answered by: Mohan

Answered On : Jun 2nd, 2006

Hi,

Advantages of views:

1. View the data without storing the data into the object.

2. Restict the view of a table i.e. can hide some of columns in the tables.

3. Join two or more tables and show it as one object to user.

4. Restict the access of a table so that nobody can insert the rows into the table.

Disadvatages:

1. Can not use DML operations on this.

2. When table is dropped view becomes inactive.. it depends on the table objects.

3. It is an object, so it occupies space.

Pls. add , if I miss any of them.

Thanks,

Mohan

Showing Answers 1 - 18 of 18 Answers
Mohan

Answered On : Jun 2nd, 2006

Hi,

Advantages of views:

1. View the data without storing the data into the object.

2. Restict the view of a table i.e. can hide some of columns in the tables.

3. Join two or more tables and show it as one object to user.

4. Restict the access of a table so that nobody can insert the rows into the table.

Disadvatages:

1. Can not use DML operations on this.

2. When table is dropped view becomes inactive.. it depends on the table objects.

3. It is an object, so it occupies space.

Pls. add , if I miss any of them.

Thanks,

Mohan

  
Login to rate this answer.
abhinav28

Answered On : Jun 23rd, 2006

hi,

Just to add ..Views don't consume space as they are created dynamically ...ex- when you do select * from view_name ;

  
Login to rate this answer.
sippsin

Answered On : Jun 28th, 2006

View all answers by sippsin

You can update (DML) a table through a view if  the view is created using a single table. If the view is created using multiple tables, then if the tables are normalised using constraints, you could update those tables too through the view.

  
Login to rate this answer.
sippsin

Answered On : Jun 28th, 2006

View all answers by sippsin

The inline view is a construct in Oracle SQL where you can place a query in the SQL FROM, clause, just as if the query was a table name.

select
   fs.tablespace_name                          "Tablespace",
   (df.totalspace - fs.freespace)              "Used MB",
   fs.freespace                                "Free MB",
   df.totalspace                               "Total MB",
   round(100 * (fs.freespace / df.totalspace)) "Pct. Free"
from
   (select
      tablespace_name,
      round(sum(bytes) / 1048576) TotalSpace
   from
      dba_data_files
   group by
      tablespace_name
   ) df,
   (select
      tablespace_name,
      round(sum(bytes) / 1048576) FreeSpace
   from
      dba_free_space
   group by
      tablespace_name
   ) fs
where
   df.tablespace_name = fs.tablespace_name;

  
Login to rate this answer.

advantages

1. hiding the data.

2. you can use two tables data in view.

3. security will be there.

disadvantages

1.when table is not there view will not work.

2. dml is not possible if that is more than one table.

3. it is also database object so it will occupy the space.

  
Login to rate this answer.
YOGENDRA SHRIVASTAVA

Answered On : Nov 26th, 2006

 hello sir,

            plz clear that. is view has storage space. if not then y u written this

           "it is also database object so it will occupy the space."

  
Login to rate this answer.
Thulasidas

Answered On : Nov 26th, 2006

another disadvantage of a view is, it affects performance. Querying from view takes more time than directly querying from the table

  
Login to rate this answer.
Indira

Answered On : Dec 2nd, 2006

Hi,Only the view definition is stored as a select statement in the data dictionary. Each time a view is accessed the select statement is executed and the rows are retrieved. It does not own data of its own ,so occupies negligable amount of space. It is also useful in hiding some columns from the original tables and the user can be restrictedfrom viewing all the columnsIndira

  
Login to rate this answer.
DHRUVA SEN GUPTA

Answered On : Apr 26th, 2007

View based on multiple tables are up-datable using INSTEAD OF triggers.

  
Login to rate this answer.
shalini parekh

Answered On : Nov 14th, 2011

hi!
i would like to add another point to the disadvantages of view...


DISADVANTAGES OF VIEW:

A query fired on a view will run slower than a query fired on a base table ,this is because the view definition has to be retrieved from the oracle's system catalog,the base table has to identified and opened in memory and then view has to be constructed on the top of the base table,suitably masking table columns

  
Login to rate this answer.
Pralay

Answered On : May 29th, 2012

View needs very less space. Only view definition needs the database space where it does not store any data in it.

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

View is a virtual table. when base table is deleted then view is not in use.

  
Login to rate this answer.
Sarvesh

Answered On : Aug 24th, 2012

Views does not require any space in the database.

  
Login to rate this answer.
millar

Answered On : Sep 13th, 2012

some view cannot be updated when it contains group by,order by clauses, which are said to be non updatable views, this type of view can be updated using INSTEAD OF TRIGGERS , the purpose of instead of triggers when a dml statement is issued against a view, instead of updating the trigger, instead of trigger will update the bast table containing the view

  
Login to rate this answer.
Sadashiv

Answered On : Nov 14th, 2012

Views do not actually store the data. So only for the view definition the space is required of the database.

  
Login to rate this answer.
vin

Answered On : Nov 22nd, 2012

We can perform DML operations on view
and a view does not occupy any physical space in db.

  
Login to rate this answer.
purna chandrudu

Answered On : May 13th, 2013

DML operation can performed on views.

  
Login to rate this answer.
soumya

Answered On : May 17th, 2013

View when called always contacts the base table, on which it is built to get the data .so it always goes to the server thats why it degrades the performance of the server.

  
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.