This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Performing Transactions”.
1. What is known as the set of SQL statements that either executes successfully or none of them have an effect?
a) joins
b) transactions
c) filters
d) deletions
View Answer
Explanation: In MySQL, a transaction is a set of SQL statements that are run as a single unit. They can be canceled when required, but they can either execute successfully or neither of them executes.
2. What is generally done after the transactions are executed successfully?
a) delete
b) rollback
c) commit
d) update
View Answer
Explanation: In a transaction, either all the statements are executed successfully or neither of them are successful. This is facilitated by the commit and rollback capabilities. Commit is made after a transaction.
3. What is generally done if an error occurs during the transaction?
a) delete
b) rollback
c) commit
d) update
View Answer
Explanation: Whenever an error occurs during a transaction, it is generally taken to the state prior to the beginning of transaction execution. This is known as rollback. It is a set of undo operations.
4. What does ‘A’ stand for in the ACID property of transactions?
a) Availability
b) Accuracy
c) Adjustability
d) Atomicity
View Answer
Explanation: All the transaction systems have an important set of characteristics in common. This is known as the ‘ACID’ property of the transaction. It refers to the four elementary characteristics of a transaction.
5. What does ‘C’ stand for in the ACID property of transactions?
a) Compound
b) Concrete
c) Collision
d) Consistency
View Answer
Explanation: The elementary characteristics of a transaction are known as the ‘ACID’ properties. ‘ACID’ is the acronym for the four basic characteristics that a transaction must have for smooth processing.
5. What is the isolation property of transactions?
a) statements form a logic unit
b) database remains consistent
c) one transaction does not affect the other
d) transaction effects are recorded permanently
View Answer
Explanation: The ‘isolation’ property of a transaction is one of the four elementary characteristics that are expected for a database transaction to maintain throughout. The others are Atomicity, Consistency and Durability.
6. What is the command to disable autocommit and launch a transaction?
a) INITIATE TRANSACTION
b) START TRANSACTION
c) DISABLE AUTOCOMMIT
d) TRANSACTION
View Answer
Explanation: By default, MySQL runs in the autocommit mode. This means that the changes performed by individual statements or operations on tables are automatically committed to the database immediately.
7. Transactional processing provides strong guarantees about the outcome of operations.
a) True
b) False
View Answer
Explanation: A transaction can either execute successfully or it can be rolled back to the point of initiation. Once a transaction completes, changes are recorded with commit. If it fails, changes are rolled back.
8. Transactional processing requires lesser overhead due to CPU cycles and memory.
a) True
b) False
View Answer
Explanation: Transactional processing is a Compound process. The statements and the state of the database need to be kept track of during the execution of the transaction. This means CPU cycles need to be reserved.
9. What is the durability property of transactions?
a) statements form a logic unit
b) database remains consistent
c) one transaction does not affect the other
d) transaction effects are recorded permanently
View Answer
Explanation: The ‘durability’ property of a transaction is one of the four elementary characteristics that are expected for a database transaction to maintain throughout. The others are Isolation, Atomicity and Consistency.
10. How many storage engines among the following are transaction-safe?
InnoDB, Falcon, MyISAM, MEMORY
a) 1
b) 2
c) 3
d) 4
View Answer
Explanation: For some applications, transactional properties are essential. For example, financial operations usually require transaction processing. InnoDB and Falcon are transaction-safe while the other two are not.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Apply for Programming Internship
- Check MySQL Books
- Practice Programming MCQs
- Check Information Technology Books