250+ TOP MCQs on Views and Transactions and Answers

RDBMS Multiple Choice Questions 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.

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

Answer: c
Clarification: 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

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

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

  250+ TOP MCQs on Magnetic Disk and Flash Storage and Answers

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

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

Answer: a
Clarification: 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?
a) insert into ();
b) create data values ();
c) enter ();
d) insert into values ();
View Answer

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

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

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

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

  250+ TOP MCQs on Application Security and Answers

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

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

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top