This is the DBMS questions and answers section on "Views" with explanation for various interview, competitive examination and entrance test. Solved examples with detailed answer description, explanation are given and it would be easy to understand.
Which of the following creates a virtual relation for storing the query ?
- A. Function
- B. View
- C. Procedure
- D. None of the mentioned
Answer: Option B
Any such relation that is not part of the logical model, but is made visible to a
user as a virtual relation, is called a view.
Which of the following is the syntax for views where v is view name ?
- A. Create view v as “query name”;
- B. Create “query expression” as view;
- C. Create view v as “query expression”;
- D. Create view “query expression”;
Answer: Option C
Create view v as “query expression”;
is any legal query expression. The view name is represented by v
Materialised views make sure that
- A. View definition is kept stable
- B. View definition is kept up-to-date
- C. View definition is verified for error
- D. View is deleted after specified time
Answer: Option B
View definition is kept up-to-date
Updating the value of the view
- A. Will affect the relation from which it is defined
- B. Will not change the view definition
- C. Will not affect the relation from which it is defined
- D. Cannot determine
Answer: Option A
Will affect the relation from which it is defined
SQL view is said to be updatable (that is, inserts, updates or deletes can be applied on the view) if which of the following conditions are satisfied by the query defining the view?
- A. The from clause has only one database relation.
- B. The query does not have a group by or having clause.
- C. The select clause contains only attribute names of the relation, and does not have any expressions, aggregates, or distinct specification.
- D. All of the mentioned
Answer: Option D
All of the mentioned
All of the conditions must be satisfied to update the view in sql.