Software Development Exam  >  Software Development Tests  >  Database Management System (DBMS)  >  Test: Transaction Management - 1 - Software Development MCQ

Test: Transaction Management - 1 - Software Development MCQ


Test Description

15 Questions MCQ Test Database Management System (DBMS) - Test: Transaction Management - 1

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

Which of the following is NOT a characteristic of a database transaction?

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

Flexibility is not a characteristic of a database transaction. The correct characteristics are Atomicity, Consistency, Isolation, and Durability (ACID).

Test: Transaction Management - 1 - Question 2

Which of the following is the correct order of transaction states in DBMS?

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

The correct order of transaction states in DBMS is Active, Committed, Partially Committed, and Aborted.

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

Which of the following is NOT an acid property of database transactions?

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

Integrity is not an ACID property of database transactions. The correct ACID properties are Atomicity, Consistency, Isolation, and Durability.

Test: Transaction Management - 1 - Question 4

In a database transaction, the rollback operation is used to:

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

The rollback operation is used to undo the changes made in the transaction and restore the database to its state before the transaction started.

Test: Transaction Management - 1 - Question 5

Which of the following isolation levels allows the highest concurrency in database transactions?

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

Read Uncommitted isolation level allows the highest concurrency in database transactions as it allows dirty reads.

Test: Transaction Management - 1 - Question 6

Consider the following SQL code:
BEGIN TRANSACTION;
UPDATE Customers SET City = 'New York' WHERE CustomerID = 1;
COMMIT;
What will be the output of this code?

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

The UPDATE statement will update the City value for the row with CustomerID 1 to 'New York', and the COMMIT statement will save the changes permanently.

Test: Transaction Management - 1 - Question 7

Consider the following SQL code:
BEGIN TRANSACTION;
INSERT INTO Orders (OrderID, CustomerID, OrderDate) VALUES (1, 10, '2023-05-15');
INSERT INTO OrderDetails (OrderID, ProductID, Quantity) VALUES (1, 100, 5);
COMMIT;
What will be the output of this code?

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

The two INSERT statements will insert rows into the Orders and OrderDetails tables, and the COMMIT statement will save the changes permanently.

Test: Transaction Management - 1 - Question 8

Consider the following SQL code:
BEGIN TRANSACTION;
DELETE FROM Customers WHERE CustomerID = 5;
ROLLBACK;
What will be the output of this code?

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

The DELETE statement will attempt to delete the row with CustomerID 5, but the ROLLBACK statement will undo the changes made in the transaction, so the row will not be deleted.

Test: Transaction Management - 1 - Question 9

Consider the following SQL code:
BEGIN TRANSACTION;
UPDATE Products SET Price = Price * 1.1 WHERE Category = 'Electronics';
SAVEPOINT sp1;
UPDATE Products SET Price = Price * 1.2 WHERE Category = 'Furniture';
ROLLBACK TO sp1;
COMMIT;
What will be the output of this code?

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

The SAVEPOINT sp1 creates a savepoint in the transaction. The second UPDATE statement modifies the Price values in the 'Furniture' category, but the ROLLBACK TO sp1 statement will roll back the transaction to the savepoint, undoing the changes in the 'Furniture' category.

Test: Transaction Management - 1 - Question 10

Consider the following SQL code:
BEGIN TRANSACTION;
SELECT * FROM Orders;
UPDATE Orders SET OrderDate = '2023-06-01' WHERE OrderID = 1;
SELECT * FROM Orders;
ROLLBACK;
SELECT * FROM Orders;
What will be the output of this code?

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

The first SELECT statement will display the original set of rows from the Orders table. The UPDATE statement will update the OrderDate for the row with OrderID 1, and the second SELECT statement after the COMMIT will display the updated set of rows. The ROLLBACK statement is not executed, so it doesn't affect the output.

Test: Transaction Management - 1 - Question 11

Consider the following SQL code:
BEGIN TRANSACTION;
UPDATE Employees SET Salary = Salary + 500 WHERE Department = 'IT';
COMMIT;
Which of the following ACID properties does this code violate?

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

The code violates the Atomicity property because it performs multiple salary updates within a single transaction. If one update fails, the others will still be committed, leading to an inconsistent state.

Test: Transaction Management - 1 - Question 12

Consider the following SQL code:
BEGIN TRANSACTION;
INSERT INTO Customers (CustomerID, Name) VALUES (1, 'John');
INSERT INTO Customers (CustomerID, Name) VALUES (1, 'Jane');
COMMIT;
Which of the following ACID properties does this code violate?

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

The code violates the Consistency property because it attempts to insert duplicate values for the CustomerID in the Customers table, which violates the uniqueness constraint. This results in an inconsistent state.

Test: Transaction Management - 1 - Question 13

Consider the following SQL code:
BEGIN TRANSACTION;
UPDATE Products SET Stock = Stock - 10 WHERE ProductID = 1;
SAVEPOINT sp1;
UPDATE Products SET Stock = Stock - 20 WHERE ProductID = 2;
ROLLBACK TO sp1;
COMMIT;
What will be the output of this code?

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

The SAVEPOINT sp1 creates a savepoint, and the ROLLBACK TO sp1 statement rolls back the transaction to the savepoint. Therefore, the changes made for both ProductID 1 and ProductID 2 will be undone.

Test: Transaction Management - 1 - Question 14

Consider the following SQL code:
BEGIN TRANSACTION;
UPDATE Orders SET Status = 'Shipped' WHERE OrderID = 1;
DELETE FROM OrderDetails WHERE OrderID = 1;
COMMIT;
What will be the output of this code?

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

The code will update the Status value for OrderID 1 in the Orders table to 'Shipped' and delete the corresponding rows from the OrderDetails table. If there are no errors, there won't be any output.

Test: Transaction Management - 1 - Question 15

Consider the following SQL code:
BEGIN TRANSACTION;
SELECT SUM(Quantity) FROM OrderDetails WHERE OrderID = 1;
UPDATE Orders SET TotalQuantity = <result of the previous query> WHERE OrderID = 1;
COMMIT;
Which of the following ACID properties does this code violate?

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

The code violates the Consistency property because it calculates the sum of Quantity from the OrderDetails table and updates the TotalQuantity in the Orders table based on that value. However, if other transactions modify the OrderDetails table before the UPDATE statement, it may result in inconsistent TotalQuantity values.

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

Top Courses for Software Development

Download as PDF

Top Courses for Software Development