What is a view? Why use it?

Answers were Sorted based on User's Feedback



What is a view? Why use it? ..

Answer / babji009

A view is a virtual table made up of data from base
tables and other views, but not stored separately.
Ex:
CREATE VIEW GOOD1_SUPPLIERS
AS SELECT S#, STATUS, CITY
FROM S
WHERE STATUS > 15;
SELECT * FROM GOOD1_SUPPLIERS;

---------+---------+---------+---------+-----------
SELECT * FROM GOOD1_SUPPLIERS;
---------+---------+---------+---------+-----------
S# STATUS CITY
---------+---------+---------+---------+---
S3 40 PARIS
S4 110 LONDON
S8 30 ATHENS
S7 20 U.S.A

Is This Answer Correct ?    7 Yes 1 No

What is a view? Why use it? ..

Answer / om yadav

after a table is created and populated with data, it may
become necessary to prevent all users from accessing all
column of a table, for data security reasons.
To reduce redundant data to the minimum possible, allows the
creation of an object called VIEW.
Define:= A VIEW is mapped , to a select sentence. The SELECT
clause consists of a sub-set of the columnb of the table.
thus a view , which is mapped to a table, will in effect
have a sub-set of the actual column of the table from which
it is bulit.

This technique offers a simple, effective way of hiding
column of the table.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More DB2 Interview Questions

What is deadlock?

2 Answers  


What is the difference between nvl and coalesce?

0 Answers  


What if we try to insert the base table through updatable view , but failed to give a column value which is defined as NOT NULL.

1 Answers   Cap Gemini,


wt is view ? wht r the restrictions for view ?

3 Answers   Verizon,


DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?

0 Answers  


What are the contents of a DCLGEN?

4 Answers   MetLife,


What are the 4 environments which can access DB2 ?

2 Answers  


What are the three DB2 date and time data types and their associated functions?

1 Answers  


Is it possible to precompile if db2 goes down?

4 Answers   Target,


What will the DB2 optimizer do?

2 Answers  


What are the various locks available?

5 Answers   CTS,


What is SPUFI?

4 Answers  


Categories