Database Questions and Answers – Snapshot Isolation

This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Snapshot Isolation”.

1. Snapshot isolation is a particular type of ______________ scheme.
a) Concurrency-control
b) Concurrency-allowance
c) Redirection
d) Repetition-allowance
View Answer

Answer: a
Explanation: It has gained wide acceptance in commercial and open-source systems, including Oracle, PostgreSQL, and SQL Server.

2. Snapshot isolation is used to give
a) Transaction a snapshot of the database
b) Database a snapshot of the transaction
c) Database a snapshot of committed values in the transaction
d) Transaction a snapshot of the database and Database a snapshot of committed values in the transaction
View Answer

Answer: d
Explanation: The data values in the snapshot consist only of values written by committed transactions.

3. Lost update problem is
a) Second update overwrites the first
b) First update overwrites the second
c) The updates are lost due to conflicting problem
d) None of the mentioned
View Answer

Answer: a
Explanation: Lost update problem has to be resolved.
advertisement
advertisement

4. Under first updater wins the system uses a __________ mechanism that applies only to updates.
a) Close
b) Read
c) Locking
d) Beat
View Answer

Answer: c
Explanation: Reads are unaffected by this, since they do not obtain locks.

5. When a transaction Ti attempts to update a data item, it requests a _________ on that data item.
a) Read lock
b) Update lock
c) Write lock
d) Chain lock
View Answer

Answer: c
Explanation: Reads are unaffected by this, since they do not obtain locks.

6. Each of a pair of transactions has read data that is written by the other, but there is no data written by both transactions, is referred to as
a) Read skew
b) Update skew
c) Write lock
d) None of the mentioned
View Answer

Answer: d
Explanation: Write skew is the issue addressed here.

7. An application developer can guard against certain snapshot anomalies by appending a ______ clause to the SQL select query.
a) For update
b) For read
c) For write
d) None of the mentioned
View Answer

Answer: a
Explanation: Adding the for update clause causes the system to treat data that are read as if they had been updated for purposes of concurrency control.
advertisement

8. Evaluate the CREATE TABLE statement:

CREATE TABLE products
(product_id NUMBER(6) CONSTRAINT prod_id_pk PRIMARY KEY, product_name VARCHAR2(15));

Which statement is true regarding the PROD_ID_PK constraint?
a) It would be created only if a unique index is manually created first
b) It would be created and would use an automatically created unique index
c) It would be created and would use an automatically created no unique index
d) It would be created and remains in a disabled state because no index is specified in the command
View Answer

Answer: b
Explanation: Syntax: create table table_name(name constraint).
advertisement

9. Evaluate the following CREATE SEQUENCE statement:

CREATE SEQUENCE seq1
START WITH 100
INCREMENT BY 10
MAXVALUE 200
CYCLE
NOCACHE;

The sequence SEQ1 has generated numbers up to the maximum limit of 200. You issue the following SQL statement:
SELECT seq1.nextval FROM dual;
What is displayed by the SELECT statement?
a) 1
b) 10
c) 100
d) an error
View Answer

Answer: a
Explanation: Sequence is used to generate a series of values.

10. In which scenario would you use the ROLLUP operator for expression or columns within a GROUP BY clause?
a) To find the groups forming the subtotal in a row
b) To create group-wise grand totals for the groups specified within a GROUP BY clause
c) To create a grouping for expressions or columns specified within a GROUP BY clause in one direction, from
right to left for calculating the subtotals
d) To create a grouping for expressions or columns specified within a GROUP BY clause in all possible
directions, which is cross-tabular report for calculating the subtotals
View Answer

Answer: c
Explanation: Sequence is used to generate a series of values.

Sanfoundry Global Education & Learning Series – Database Management System.

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.