Database transactions and ACID exam review
Review key concepts of database transactions and the ACID properties essential for maintaining data integrity in relational databases.
Quiz(32 questions)
1. What is the primary purpose of a database transaction?
Terms in this Study Set(32)
Database Transactions(16)
What is a database transaction?
A sequence of operations performed as a single logical unit of work. It ensures data integrity and consistency.
True or False: Transactions can partially complete.
False: Transactions must fully complete or not at all, maintaining atomicity.
Fill in the blank: Transactions are essential for _____ in databases.
data integrity.
Examples of transaction operations?
- Insert - Update - Delete
What are the two types of transactions?
Simple (single operation) and Complex (multiple operations).
Cause → Effect: A transaction fails.
The database rolls back to its previous state, ensuring no partial changes.
Difference between persistent and transient transactions?
Persistent transactions save changes permanently, while transient transactions do not.
What are the main properties of transactions?
Atomicity, Consistency, Isolation, Durability (ACID).
What happens during a rollback?
All operations of the transaction are undone, reverting to the last stable state.
True or False: Transactions can be nested.
True: Transactions can contain other transactions, known as nested transactions.
Short example of a simple transaction.
Transfer $100 from Account A to Account B: 1. Deduct $100 from A. 2. Add $100 to B.
What is a commit in transaction?
The operation that finalizes all changes made during the transaction.
Comparison: Read-only vs. Read-write transactions?
Read-only transactions do not modify data; read-write transactions can modify data.
What does isolation ensure in transactions?
That concurrent transactions do not affect each other's execution.
Fill in the blank: Consistency ensures data _____ before and after a transaction.
remains valid.
What role does locking play in transactions?
Locks prevent other transactions from accessing the same data concurrently, ensuring isolation.
ACID Properties(16)
What does Atomicity mean in ACID?
Atomicity ensures that all operations in a transaction are completed or none at all. It guarantees transactions are indivisible.
Fill in the blank: ACID stands for ___.
Atomicity, Consistency, Isolation, Durability.
True or False: Durability guarantees data is lost after a crash.
False. Durability ensures that once a transaction is committed, it remains so even in case of a failure.
What is Consistency in the context of ACID?
Consistency ensures that a transaction takes the database from one valid state to another, preserving all defined rules and constraints.
Compare Atomicity and Durability.
Atomicity: all or nothing. Durability: committed transactions survive failures.
What is Isolation in ACID properties?
Isolation ensures that transactions do not interfere with each other, maintaining data integrity during concurrent operations.
Cause → Effect: Low Isolation leads to ___ .
Dirty reads, lost updates, or inconsistent data.
What is an example of Durability?
After a bank transaction commits, the changes persist even if the server crashes immediately after.
How does ACID relate to reliability?
ACID properties collectively enhance database reliability and integrity, ensuring robust transaction management.
True or False: Isolation can allow transactions to see each other’s intermediate states.
False. Isolation prevents transactions from seeing each other’s intermediate states, ensuring data integrity.
What happens if Atomicity is compromised?
Partial updates may occur, leading to data inconsistency and potential corruption.
Fill in the blank: A consistent database state means ___ .
All defined rules and constraints are satisfied.
What does a lack of Durability imply?
Data changes may be lost due to system crashes after a transaction is committed.
Compare Consistency and Atomicity.
Consistency: valid state transitions. Atomicity: all-or-nothing transaction execution.
What’s a real-world example of Isolation?
Two ATM transactions occurring simultaneously without affecting each other's account balance.
True or False: Isolation can lead to higher system performance.
True. Proper isolation levels can optimize concurrent access while maintaining data integrity.
Questions in this Study Set(32)
1. What is the primary purpose of a database transaction?
2. What does Atomicity ensure in a transaction?
3. True or False: A transaction can be considered successful if only part of it completes.
4. Which of the following does ACID NOT stand for?
5. Fill in the blank: Transactions are crucial for _____ in a database.
6. True or False: Durability implies data is recoverable after a crash.
7. Which of the following is NOT a typical operation involved in a transaction?
8. What does Consistency guarantee in a database?
9. What is a complex transaction?
10. Which of the following best describes Isolation?
11. What occurs when a transaction fails?
12. What could be a consequence of low Isolation levels?
13. What distinguishes persistent transactions from transient transactions?
14. What is an example of Durability in database transactions?
15. Which of the following is NOT a property of ACID transactions?
16. How does ACID contribute to database reliability?
17. During a rollback, what happens to the changes made by a transaction?
18. True or False: Isolation can lead to better performance in a database system.
19. True or False: Nested transactions can occur within a main transaction.
20. What happens if Atomicity fails during a transaction?
21. Provide a short example of a transaction.
22. Fill in the blank: A database is in a consistent state when ___.
23. What is the purpose of a commit in a transaction?
24. What does a lack of Durability imply for transactions?
25. How do read-only transactions differ from read-write transactions?
26. Compare Consistency and Atomicity: which statement is true?
27. What does isolation ensure in the context of database transactions?
28. What's a practical scenario demonstrating Isolation?
29. Fill in the blank: Consistency guarantees that data _____ before and after a transaction.
30. True or False: Higher Isolation levels may decrease database performance.
31. What role does locking play in database transactions?
32. What is the primary role of Atomicity in ACID properties?
Related Study Sets
SQL GROUP BY und HAVING
Transaktionen ACID Definitionen
Wiederholung: Tabelle Schlüssel
SQL WHERE
Abitur: SQL JOIN Idee
SQL subqueries flashcards
SQL GROUP BY and aggregate functions
Relationale Algebra
Create Your Own Study Set
Upload a PDF, paste your notes, or describe a topic – AI generates flashcards, quizzes and more in seconds.

