RDBMS Questions and Answers – Views and Transactions

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

Answer: b
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

Answer: c
Explanation: We use the create view command to define a view in SQL.

3. create view studentdet
select ID, address, name
from student;

advertisement
advertisement

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

Answer: d
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

Answer: a
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.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: d
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

Answer: a
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.
advertisement

7. How can we insert data into a view?
a) insert into ();
b) create data values ();
c) enter ();
d) insert into values ();
View Answer

Answer: d
Explanation: We can insert data into a view using the inset into values (); statement. This operation can be done only if the view is updatable.

8. State true or false: We can update a view if it has multiple database relations in the from clause
a) True
b) False
View Answer

Answer: b
Explanation: We can update a view only if it has a single database relation in the “from” clause.
advertisement

9. The _______ statement makes the updates performed by the transaction permanent.
a) Finalize work
b) Finish work
c) Commit work
d) None of the mentioned
View Answer

Answer: c
Explanation: The Commit work statement makes the updates performed by the transaction permanent. After a transaction is committed, a new transaction is automatically started.

10. The _______ statement causes the statements to undo all the updates performed on the transaction
a) Undo work
b) Rollback work
c) Commit work
d) Replace work
View Answer

Answer: b
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.

Sanfoundry Global Education & Learning Series – RDBMS.

To practice all areas of RDBMS, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.