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 the role of schema in the db2 database?

0 Answers  


Suppose the outcome of executing a query results in a row having null. Based on the answer how you use it? Its declaration and inclusion?

2 Answers   Verizon,


How do we specify index to include or not during bind process.

0 Answers   Satyam,


What is the difference between plan and package in db2?

0 Answers  


pls tell me abt the normalization five types....

2 Answers  






What is the purpose of the DSNC transaction ?

1 Answers  


OUTER JOINS USED TO GET MATCHING AND NONMATCHING ROWS FORM 2 OR MORE TABLES BASED ON COLUMNS. SIMPLE JOINS ALSO DO THE SAME THEN WHAT IS THE USE OF OUTER JOINS.

1 Answers   Syntel,


I have a main program (A) where we delete some rows in table in a cursor, and we commit it in sub program(B). What will happen - will we get an error or not?

2 Answers  


Which component is used to execute the sql statements?

0 Answers  


Write a query to retrive partial string.

2 Answers  


What is the maximum length of a column name in DB2? 18 or 30 or anything other than these?

4 Answers  


what is the use of cursors?

3 Answers   iGate,


Categories