This set of RDBMS Multiple Choice Questions & Answers (MCQs) focuses on “Views and Transactions”.
1. What is a view?
a) An brief description of the schema diagram.
b) A relation that is not a part of the schema but is a virtual relation
c) Any relation that is a part of the schema
d) A relation that is a part of the schema but which needs to be specified in every operation made on that particular relation.
View Answer
Explanation: A relation that is not a part of the schema but is a virtual relation is called as view. Views improve writability as viewing the entire logical model is not feasible.
2. What is the command used to define view in SQL?
a) define view
b) new view
c) create view
d) none of the mentioned
View Answer
Explanation: We use the create view command to define a view in SQL.
3. create view studentdet
select ID, address, name
from student;
What is the result of the above query?
a) It creates a view named studentdet with 3 attributes
b) It creates a view named studentdet with 1 attribute
c) It creates a view named ID with 2 attributes
d) It is syntactically wrong and does not give a result
View Answer
Explanation: immediately after specifying the name of the view, we have to write the “as” keyword. So this query does not give any result as it is syntactically incorrect.
4. State true or false: One view can be used in the expression defining another view
a) True
b) False
View Answer
Explanation: One view can be used to define another view in its expression. This further improves the writability of the code as we are reducing the entire logical model.
5. If the actual relations used in the view definition change, the view is updated immediately. Such views are called _________
a) Instant views
b) Instantaneous views
c) Materialistic views
d) Materialized views
View Answer
Explanation: If the actual relations used in the view definition change, the view is updated immediately. Such views are called Materialized views. Materialized views help to keep the database up-to-date.
6. The process of maintaining views up to date is called _________
a) View maintenance
b) View updating
c) View materialization
d) View isolation
View Answer
Explanation: The process of maintaining views up to date is called View maintenance. View maintenance can be done immediately when any of the views is updated.
7. How can we insert data into a view? 8. State true or false: We can update a view if it has multiple database relations in the from clause 9. The _______ statement makes the updates performed by the transaction permanent. 10. The _______ statement causes the statements to undo all the updates performed on the transaction Sanfoundry Global Education & Learning Series – RDBMS. To practice all areas of RDBMS, here is complete set of 1000+ Multiple Choice Questions and Answers.
a) insert into
b) create data
c) enter
d) insert into
View Answer
Explanation: We can insert data into a view using the inset into
a) True
b) False
View Answer
Explanation: We can update a view only if it has a single database relation in the “from” clause.
a) Finalize work
b) Finish work
c) Commit work
d) None of the mentioned
View Answer
Explanation: The Commit work statement makes the updates performed by the transaction permanent. After a transaction is committed, a new transaction is automatically started.
a) Undo work
b) Rollback work
c) Commit work
d) Replace work
View Answer
Explanation: The Rollback work statement causes the statements to undo all the updates performed on the transaction. The database is then restored to the state of what it was before the first statement of the transaction was executed.