Software Development Exam  >  Software Development Tests  >  Test: Transaction Management - 2 - Software Development MCQ

Test: Transaction Management - 2 - Software Development MCQ


Test Description

15 Questions MCQ Test - Test: Transaction Management - 2

Test: Transaction Management - 2 for Software Development 2024 is part of Software Development preparation. The Test: Transaction Management - 2 questions and answers have been prepared according to the Software Development exam syllabus.The Test: Transaction Management - 2 MCQs are made for Software Development 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Transaction Management - 2 below.
Solutions of Test: Transaction Management - 2 questions in English are available as part of our course for Software Development & Test: Transaction Management - 2 solutions in Hindi for Software Development course. Download more important topics, notes, lectures and mock test series for Software Development Exam by signing up for free. Attempt Test: Transaction Management - 2 | 15 questions in 30 minutes | Mock test for Software Development preparation | Free important questions MCQ to study for Software Development Exam | Download free PDF with solutions
Test: Transaction Management - 2 - Question 1

Which of the following statements best describes a database transaction?

Detailed Solution for Test: Transaction Management - 2 - Question 1

A database transaction is a unit of work that should be executed as a complete entity. It ensures that either all the changes made by the transaction are applied to the database (committed) or none of them are (rolled back).

Test: Transaction Management - 2 - Question 2

What is the purpose of a transaction log in a DBMS?

Detailed Solution for Test: Transaction Management - 2 - Question 2

The transaction log is used to record all the changes made to the database during the execution of a transaction. It provides a way to recover the database in case of failures or rollbacks.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Transaction Management - 2 - Question 3

Which of the following is NOT a property of a transaction in DBMS?

Detailed Solution for Test: Transaction Management - 2 - Question 3

Scalability is not a property of a transaction. The properties of a transaction in DBMS are ACID properties: Atomicity, Consistency, Isolation, and Durability.

Test: Transaction Management - 2 - Question 4

What is the primary purpose of concurrency control in DBMS?

Detailed Solution for Test: Transaction Management - 2 - Question 4

Concurrency control in DBMS is used to manage access to shared resources (e.g., database tables) and prevent conflicts when multiple transactions are executed concurrently. It ensures that transactions are executed in a way that maintains data consistency.

Test: Transaction Management - 2 - Question 5

Which of the following isolation levels provides the highest degree of concurrency but may lead to non-repeatable reads?

Detailed Solution for Test: Transaction Management - 2 - Question 5

Read Uncommitted isolation level allows uncommitted changes made by other transactions to be visible, which can lead to non-repeatable reads. The other isolation levels (Read Committed, Repeatable Read, Serializable) provide stronger guarantees but may have a lower degree of concurrency.

Test: Transaction Management - 2 - Question 6

Consider the following transaction code:

BEGIN TRANSACTION;
UPDATE products SET price = price * 1.1 WHERE category = 'Electronics';
COMMIT;
What will be the outcome of this transaction?

Detailed Solution for Test: Transaction Management - 2 - Question 6

The UPDATE statement will modify the price of all products in the 'Electronics' category, increasing it by 10%. The transaction is then committed, and the changes are permanently applied to the database.

Test: Transaction Management - 2 - Question 7

Consider the following transaction code:

BEGIN TRANSACTION;
SELECT COUNT(*) FROM orders;
ROLLBACK;

Detailed Solution for Test: Transaction Management - 2 - Question 7

The transaction is rolled back using the ROLLBACK statement. This means that the changes made by the transaction are undone, and the database returns to its previous state. Therefore, no result will be displayed.

Test: Transaction Management - 2 - Question 8

Consider the following transaction code:

BEGIN TRANSACTION;
UPDATE customers SET balance = balance - 100 WHERE id = 1;
UPDATE customers SET balance = balance + 100 WHERE id = 2;
COMMIT;
If the initial balance of customer 1 is $500 and customer 2 is $300, what will be the final balance of customer 1 and customer 2 after the transaction is committed?

Detailed Solution for Test: Transaction Management - 2 - Question 8

The first UPDATE statement reduces the balance of customer 1 by $100, resulting in a balance of $400. The second UPDATE statement tries to increase the balance of customer 2 by $100, but since the initial balance is $300, the update will not take place. Hence, the final balances are $400 and $300, respectively.

Test: Transaction Management - 2 - Question 9

Consider the following transaction code:

BEGIN TRANSACTION;
SELECT COUNT(*) FROM products WHERE category = 'Clothing';
UPDATE products SET price = price * 0.9 WHERE category = 'Clothing';
COMMIT;

Detailed Solution for Test: Transaction Management - 2 - Question 9

The transaction starts with a SELECT statement to count the number of products in the 'Clothing' category. However, without using a transaction isolation level like SERIALIZABLE, the subsequent UPDATE statement may conflict with concurrent transactions and cause the entire transaction to be rolled back.

Test: Transaction Management - 2 - Question 10

Consider the following transaction code:

BEGIN TRANSACTION;
INSERT INTO orders (customer_id, product_id, quantity) VALUES (1, 100, 5);
INSERT INTO orders (customer_id, product_id, quantity) VALUES (2, 200, 3);
COMMIT;
What will be the outcome of this transaction?

Detailed Solution for Test: Transaction Management - 2 - Question 10

The transaction starts by inserting two new orders into the "orders" table. If the INSERT statements execute successfully without violating any constraints, the changes will be committed, and the new orders will be added to the database.

Test: Transaction Management - 2 - Question 11

Which of the following is an example of a concurrency control technique used in DBMS to handle conflicts between transactions?

Detailed Solution for Test: Transaction Management - 2 - Question 11

Two-Phase Locking (2PL) is a popular concurrency control technique used in DBMS to handle conflicts between transactions. It ensures serializability by acquiring all necessary locks before accessing data and releasing them only after the transaction is complete.

Test: Transaction Management - 2 - Question 12

Which of the following is a necessary condition for a schedule to be serializable in DBMS?

Detailed Solution for Test: Transaction Management - 2 - Question 12

Conflict Serializability is a necessary condition for a schedule to be serializable in DBMS. It means that the order of conflicting operations (e.g., read-write or write-write) in the schedule must be the same as in some serial execution.

Test: Transaction Management - 2 - Question 13

Which of the following is a violation of the serializability property in DBMS?

Detailed Solution for Test: Transaction Management - 2 - Question 13

Lost Update is a violation of the serializability property in DBMS. It occurs when one transaction overwrites the changes made by another transaction before they are committed, leading to the loss of the intermediate update.

Test: Transaction Management - 2 - Question 14

Which of the following techniques is used to ensure isolation and consistency in DBMS?

Detailed Solution for Test: Transaction Management - 2 - Question 14

Multi-Version Concurrency Control (MVCC) is a technique used to ensure isolation and consistency in DBMS. It allows multiple versions of data items to coexist, allowing transactions to read a consistent snapshot of the database without blocking concurrent writes.

Test: Transaction Management - 2 - Question 15

Which of the following is a correct statement about the strict two-phase locking (2PL) protocol in DBMS?

Detailed Solution for Test: Transaction Management - 2 - Question 15

While strict two-phase locking (2PL) protocol ensures serializability, it does not prevent deadlocks. Deadlocks can still occur when transactions hold exclusive locks and request additional locks that are being held by other transactions, resulting in a cyclic dependency. Additional techniques like deadlock detection and resolution are needed to handle deadlocks.

Information about Test: Transaction Management - 2 Page
In this test you can find the Exam questions for Test: Transaction Management - 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Transaction Management - 2, EduRev gives you an ample number of Online tests for practice

Top Courses for Software Development

Download as PDF

Top Courses for Software Development