1A logical unit of database processing that includes one or more database access operations is known as:
A.A Schedule
B.A Transaction
C.A Lock
D.A Timestamp
Correct Answer: A Transaction
Explanation:A transaction is a logical unit of work that performs a sequence of operations (reads and writes) on a database.
Incorrect! Try again.
2Which of the following is NOT one of the ACID properties of database transactions?
A.Atomicity
B.Consistency
C.Integrity
D.Durability
Correct Answer: Integrity
Explanation:ACID stands for Atomicity, Consistency, Isolation, and Durability. Integrity is a general database concept but 'I' in ACID refers to Isolation.
Incorrect! Try again.
3The property that ensures that all operations of a transaction are reflected in the database or none are is called:
A.Atomicity
B.Consistency
C.Isolation
D.Durability
Correct Answer: Atomicity
Explanation:Atomicity ensures the 'all or nothing' rule. If a transaction fails, all its effects must be undone.
Incorrect! Try again.
4Which component of the DBMS is primarily responsible for ensuring the Durability property?
A.Concurrency Control Manager
B.Query Optimizer
C.Recovery Manager
D.Buffer Manager
Correct Answer: Recovery Manager
Explanation:The Recovery Manager is responsible for restoring the database to a consistent state after a failure, ensuring durability.
Incorrect! Try again.
5If a transaction executes updates on rows that are being read by another transaction concurrently, violating the logical correctness of data, which property is compromised?
A.Atomicity
B.Consistency
C.Isolation
D.Durability
Correct Answer: Isolation
Explanation:Isolation ensures that concurrently executing transactions do not interfere with each other, making them appear as if they executed serially.
Incorrect! Try again.
6In a state transition diagram of a transaction, a transaction enters the Committed state after:
A.The first operation is executed
B.All operations are executed and the final check passes
C.A system failure occurs
D.The transaction is rolled back
Correct Answer: All operations are executed and the final check passes
Explanation:A transaction enters the committed state only after successfully completing all operations and successfully writing log records to stable storage.
Incorrect! Try again.
7A transaction that has not yet completed all its operations but has executed the final statement is in which state?
A.Active
B.Partially Committed
C.Committed
D.Aborted
Correct Answer: Partially Committed
Explanation:The 'Partially Committed' state occurs after the final statement has been executed but before the check to see if changes can be permanently saved.
Incorrect! Try again.
8Which of the following operations is used to permanently save the work done by a transaction?
A.ROLLBACK
B.COMMIT
C.SAVEPOINT
D.GRANT
Correct Answer: COMMIT
Explanation:The COMMIT operation signals the successful end of a transaction and permanently saves changes to the database.
Incorrect! Try again.
9A schedule in a DBMS is defined as:
A.A list of all transactions in the system
B.The chronological order in which instructions of concurrent transactions are executed
C.The time taken to execute a query
D.The priority list of users
Correct Answer: The chronological order in which instructions of concurrent transactions are executed
Explanation:A schedule represents the sequence of operations (reads, writes, commits, aborts) from multiple transactions as they are interleaved by the CPU.
Incorrect! Try again.
10In a Serial Schedule:
A.Operations of different transactions are interleaved
B.Transactions are executed one after another without interleaving
C.Parallel processing is maximized
D.Deadlocks are frequent
Correct Answer: Transactions are executed one after another without interleaving
Explanation:In a serial schedule, a transaction starts only after transaction has committed or aborted. There is no interleaving.
Incorrect! Try again.
11Consider two transactions and . A conflict exists if:
A.They belong to different schedules
B.They access different data items
C.They access the same data item, belong to different transactions, and at least one operation is a write
D.They access the same data item and both are read operations
Correct Answer: They access the same data item, belong to different transactions, and at least one operation is a write
Explanation:A conflict occurs between operations and if they belong to different transactions, access the same data item , and at least one of them is a write(Q).
Incorrect! Try again.
12Which of the following pairs of operations is NOT conflicting?
A. and
B. and
C. and
D. and
Correct Answer: and
Explanation:Two read operations on the same data item do not change the state of the data, so the order in which they execute does not matter. Thus, they do not conflict.
Incorrect! Try again.
13A schedule is Conflict Serializable if:
A.It is view equivalent to a serial schedule
B.It is conflict equivalent to a serial schedule
C.It contains no read operations
D.It results in a deadlock
Correct Answer: It is conflict equivalent to a serial schedule
Explanation:A schedule is conflict serializable if we can transform it into a serial schedule by swapping non-conflicting adjacent operations.
Incorrect! Try again.
14To test for Conflict Serializability, we construct a Precedence Graph. A cycle in this graph implies:
A.The schedule is conflict serializable
B.The schedule is NOT conflict serializable
C.The schedule is view serializable
D.The schedule is recoverable
Correct Answer: The schedule is NOT conflict serializable
Explanation:If the precedence graph (serialization graph) contains a cycle, the schedule cannot be transformed into a serial schedule via non-conflicting swaps, so it is not conflict serializable.
Incorrect! Try again.
15In a precedence graph for schedule , a directed edge is drawn if:
A. commits before
B. reads data written by (or similar conflicting op where is first)
C. and do not conflict
D. starts before
Correct Answer: reads data written by (or similar conflicting op where is first)
Explanation:An edge exists if an operation in conflicts with and precedes an operation in .
Incorrect! Try again.
16What is the relationship between View Serializability () and Conflict Serializability ()?
A. (Every conflict serializable schedule is view serializable)
B. (Every view serializable schedule is conflict serializable)
C.
D. and are disjoint
Correct Answer: (Every conflict serializable schedule is view serializable)
Explanation:Conflict serializability is a stricter condition. All conflict serializable schedules are view serializable, but there are view serializable schedules (containing blind writes) that are not conflict serializable.
Incorrect! Try again.
17A Blind Write occurs when:
A.A transaction writes a value without reading it first
B.A transaction reads a value but never writes it
C.A transaction writes to a log file only
D.A transaction writes data encrypted
Correct Answer: A transaction writes a value without reading it first
Explanation:A blind write is a write operation that is not immediately preceded by a read operation in the same transaction.
Incorrect! Try again.
18Two schedules and are View Equivalent if they satisfy conditions regarding:
A.Initial reads, Updated reads, and Final writes
B.Only Initial reads
C.Only Final writes
D.Locking protocols
Correct Answer: Initial reads, Updated reads, and Final writes
Explanation:View equivalence requires that both schedules have the same initial reads, same read-from dependencies (reads reading from specific writes), and the same final writes for all data items.
Incorrect! Try again.
19A schedule is Recoverable if:
A.For every transaction that reads from , commits after commits
B.For every transaction that reads from , commits after commits
C.There are no cascading rollbacks
D.Deadlocks are automatically resolved
Correct Answer: For every transaction that reads from , commits after commits
Explanation:To ensure recoverability, if reads a value modified by , must commit before commits. Otherwise, if aborts, would have read invalid data.
Incorrect! Try again.
20A Dirty Read occurs when:
A.A transaction reads a value written by a committed transaction
B.A transaction reads a value written by an uncommitted transaction
C.A transaction reads a value twice and gets different results
D.A transaction overwrites a value
Correct Answer: A transaction reads a value written by an uncommitted transaction
Explanation:A dirty read ( conflict) happens when a transaction reads data that has been written by another transaction that has not yet committed.
Incorrect! Try again.
21Which phenomenon leads to Cascading Rollback?
A.A committed transaction reading committed data
B.An uncommitted transaction reading data written by a transaction that subsequently fails
C.Strict locking protocols
D.Timestamp ordering
Correct Answer: An uncommitted transaction reading data written by a transaction that subsequently fails
Explanation:If reads data written by , and fails (aborts), must also be rolled back. If read from , it must also roll back, causing a cascade.
A.Transactions only read data written by committed transactions
B.Transactions commit in the order they started
C.No transaction is ever aborted
D.Transactions never write to the same data item
Correct Answer: Transactions only read data written by committed transactions
Explanation:To avoid cascading rollbacks, a transaction is not allowed to read a data item until the transaction that last wrote it has committed.
Incorrect! Try again.
23A Strict Schedule requires that:
A.A transaction can neither read nor write a data item until the last transaction that wrote has committed or aborted
B.A transaction can read but not write until the previous writer commits
C.Transactions must be executed serially
D.Strict 2PL is not used
Correct Answer: A transaction can neither read nor write a data item until the last transaction that wrote has committed or aborted
Explanation:Strict schedules prevent both Dirty Reads and situations where a write overwrites uncommitted data. This simplifies recovery (undoing a write just involves restoring the before-image).
Incorrect! Try again.
24Which of the following implies the highest level of isolation and easiest recovery?
A.Recoverable Schedule
B.Cascadeless Schedule
C.Strict Schedule
D.Serial Schedule
Correct Answer: Strict Schedule
Explanation:While a Serial schedule provides perfect isolation, among concurrent schedules, a Strict Schedule provides the strongest restrictions on reading/writing uncommitted data, simplifying recovery significantly.
Incorrect! Try again.
25The Lost Update problem occurs when:
A.Two transactions read the same data and update it based on the read value, overwriting each other's changes
B.A transaction reads uncommitted data
C.A transaction reads the same data twice and gets different values
D.A transaction fails to write to the log
Correct Answer: Two transactions read the same data and update it based on the read value, overwriting each other's changes
Explanation:This is a write-write conflict scenario. reads , reads , writes , then writes . 's update is lost.
Incorrect! Try again.
26Concurrency Control schemes are designed primarily to ensure:
A.Database security
B.Isolation and Serializability
C.Atomicity
D.Durability
Correct Answer: Isolation and Serializability
Explanation:Concurrency control protocols manage the execution order of operations to prevent interference between transactions, ensuring Isolation and Serializability.
Incorrect! Try again.
27A Lock is a variable associated with a data item that describes:
A.The size of the data item
B.The status of the data item with respect to operations that can be performed
C.The physical location of the data
D.The value of the data
Correct Answer: The status of the data item with respect to operations that can be performed
Explanation:Locks control access to data items. For example, a lock might indicate that a transaction is currently reading the item, preventing others from writing to it.
Incorrect! Try again.
28In Shared/Exclusive locking mode, which statement is true?
A.Shared Lock (S) allows Read and Write; Exclusive Lock (X) allows Write only
B.Shared Lock (S) allows Read only; Exclusive Lock (X) allows Read and Write
C.Shared Lock (S) allows Write only; Exclusive Lock (X) allows Read only
D.Both allow Read and Write
Correct Answer: Shared Lock (S) allows Read only; Exclusive Lock (X) allows Read and Write
Explanation:An S-lock is compatible with other S-locks (multiple readers), but an X-lock is incompatible with anything else (single writer, exclusive access).
Incorrect! Try again.
29If a transaction holds an Exclusive Lock (X) on item , can another transaction request a Shared Lock (S) on ?
A.Yes, immediately
B.No, it must wait
C.Yes, but only for reading
D.No, unless it upgrades
Correct Answer: No, it must wait
Explanation:Exclusive locks are not compatible with Shared locks. The requesting transaction is blocked until the X lock is released.
Incorrect! Try again.
30The Two-Phase Locking (2PL) protocol consists of which two phases?
A.Reading Phase and Writing Phase
B.Growing Phase and Shrinking Phase
C.Beginning Phase and Ending Phase
D.Locking Phase and Unlocking Phase
Correct Answer: Growing Phase and Shrinking Phase
Explanation:In 2PL, a transaction first acquires all necessary locks (Growing) and then releases them (Shrinking). Once a lock is released, no new locks can be acquired.
Incorrect! Try again.
31The primary benefit of the Two-Phase Locking (2PL) protocol is that it guarantees:
A.Freedom from Deadlocks
B.Conflict Serializability
C.View Serializability only
D.Freedom from Cascading Rollbacks
Correct Answer: Conflict Serializability
Explanation:Any schedule generated by a strict 2PL or basic 2PL protocol is guaranteed to be conflict serializable. However, 2PL does not guarantee freedom from deadlocks.
Incorrect! Try again.
32In Strict Two-Phase Locking (Strict 2PL):
A.All locks are released at once at the end of the transaction
B.Exclusive locks are held until the end of the transaction, but Shared locks can be released earlier
C.Locks can be released anytime
D.No locks are used
Correct Answer: Exclusive locks are held until the end of the transaction, but Shared locks can be released earlier
Explanation:Strict 2PL holds all Exclusive (Write) locks until commit/abort to ensure recoverability and avoid cascading aborts. (Rigorous 2PL holds all locks until the end).
Incorrect! Try again.
33What is Lock Upgrading?
A.Converting an Exclusive lock to a Shared lock
B.Converting a Shared lock to an Exclusive lock
C.Releasing all locks
D.Assigning a lock to a higher priority transaction
Correct Answer: Converting a Shared lock to an Exclusive lock
Explanation:Upgrading happens when a transaction holds a Shared lock (to read) and later needs to write, so it requests to convert the S-lock to an X-lock.
Incorrect! Try again.
34A Deadlock occurs when:
A.A transaction waits indefinitely for a lock held by another transaction, which is in turn waiting for the first
B.A transaction fails due to hardware error
C.The system runs out of memory
D.Two transactions read the same data
Correct Answer: A transaction waits indefinitely for a lock held by another transaction, which is in turn waiting for the first
Explanation:This is a circular wait condition. waits for , and waits for .
Incorrect! Try again.
35Which of the following is a method for Deadlock Prevention?
A.Wait-For Graph
B.Wait-Die Scheme
C.Timeout
D.Precedence Graph
Correct Answer: Wait-Die Scheme
Explanation:Wait-Die is a timestamp-based prevention scheme where an older transaction waits for a younger one, but a younger one dies (aborts) if it requests a lock held by an older one.
Incorrect! Try again.
36In the Wound-Wait deadlock prevention scheme:
A.Older transactions wait for younger ones
B.Younger transactions wound (abort) older ones
C.Older transactions wound (abort) younger transactions holding the lock
Explanation:If an older transaction requests a lock held by a younger transaction, the younger one is preempted (wounded/rolled back). If a younger requests an older's lock, it waits.
Incorrect! Try again.
37A Wait-For Graph is used for:
A.Deadlock Prevention
B.Deadlock Detection
C.Serializability Testing
D.Recovery
Correct Answer: Deadlock Detection
Explanation:The system periodically constructs a Wait-For Graph. If there is a cycle in the graph, a deadlock exists.
Incorrect! Try again.
38Starvation in concurrency control refers to:
A.A state where the system halts
B.A transaction waiting indefinitely while others proceed
C.Memory leakage
D.Database corruption
Correct Answer: A transaction waiting indefinitely while others proceed
Explanation:Starvation occurs if a transaction cannot acquire the necessary locks because other transactions keep acquiring them (e.g., a writer waiting for a stream of readers to finish).
Incorrect! Try again.
39In Timestamp Ordering protocols, what is ?
A.Total Size of transaction
B.Time Spent by transaction
C.Timestamp assigned to transaction at startup
D.Temporary Space for
Correct Answer: Timestamp assigned to transaction at startup
Explanation:Every transaction is assigned a unique timestamp when it begins. This determines the serializability order (older transactions first).
Incorrect! Try again.
40In the Basic Timestamp Ordering protocol, if transaction wants to write item , and , what happens?
A.The operation is allowed
B.The operation is delayed
C.Transaction is rolled back (aborted)
D.The read timestamp is updated
Correct Answer: Transaction is rolled back (aborted)
Explanation:If , it means a younger transaction has already read . If (the older transaction) writes now, it invalidates that read. Thus is too late and must abort.
Incorrect! Try again.
41What is the Thomas Write Rule?
A.A modification to 2PL
B.A modification to Timestamp Ordering that ignores outdated writes
C.A rule for logging
D.A rule for locking
Correct Answer: A modification to Timestamp Ordering that ignores outdated writes
Explanation:If , a younger transaction has already written . The Thomas Write Rule states that 's write is obsolete and can be ignored (treated as a success without writing) rather than aborting .
Incorrect! Try again.
42Which of the following describes the Phantom Phenomenon?
A.Reading a value that disappears
B.A transaction executes a range query twice and finds a new row inserted by another transaction in between
C.A system crash causing data loss
D.Locks appearing without requests
Correct Answer: A transaction executes a range query twice and finds a new row inserted by another transaction in between
Explanation:Phantoms occur when a transaction reads a set of rows satisfying a condition, and another transaction inserts/deletes a row satisfying that condition, changing the result set for a subsequent read.
Incorrect! Try again.
43Granularity in locking refers to:
A.The size of the data item that is locked (e.g., row, page, table)
B.The duration of the lock
C.The strength of the lock
D.The number of locks allowed
Correct Answer: The size of the data item that is locked (e.g., row, page, table)
Explanation:Locking granularity defines the hierarchy level at which locks are acquired. Fine granularity (row) increases concurrency but increases overhead; coarse granularity (table) decreases concurrency but lowers overhead.
Incorrect! Try again.
44What are Intention Locks (e.g., IS, IX) used for?
A.To signal the intention to lock nodes lower in the hierarchy (finer granularity)
B.To lock the database permanently
C.To replace exclusive locks
D.To prevent deadlocks
Correct Answer: To signal the intention to lock nodes lower in the hierarchy (finer granularity)
Explanation:Intention locks are used in Multiple Granularity Locking. An Intention Shared (IS) lock on a table indicates that the transaction intends to place Shared locks on individual rows within that table.
Incorrect! Try again.
45Optimistic Concurrency Control assumes that:
A.Conflicts are rare, so validation is done at the end
B.Conflicts are frequent, so locking is used
C.Transactions should strictly wait
D.Deadlocks are inevitable
Correct Answer: Conflicts are rare, so validation is done at the end
Explanation:Optimistic protocols allow transactions to proceed without locking. Before committing, a Validation Phase checks if any conflicts occurred. If so, the transaction is rolled back.
Incorrect! Try again.
46The Validation Phase in optimistic concurrency control checks for:
A.Syntax errors
B.Serializability violations
C.Disk space
D.User permissions
Correct Answer: Serializability violations
Explanation:It checks if the transaction's updates conflict with other transactions that committed since this transaction started.
Incorrect! Try again.
47Which of the following is true about Multiversion Concurrency Control (MVCC)?
A.It maintains multiple copies of data items (versions) to allow readers to read old versions without blocking writers
B.It uses only one version of data
C.It strictly forbids concurrent access
D.It is identical to 2PL
Correct Answer: It maintains multiple copies of data items (versions) to allow readers to read old versions without blocking writers
Explanation:MVCC keeps old versions of data. A reader sees a snapshot of the database consistent with its timestamp, avoiding read-write locks in many cases.
Incorrect! Try again.
48In a database, the Log is a sequence of records that maintains:
A.User login times
B.History of all updates to the database for recovery purposes
C.Query execution plans
D.Index structures
Correct Answer: History of all updates to the database for recovery purposes
Explanation:The Write-Ahead Log (WAL) records every change (old value, new value) before it is written to the database, enabling Undo/Redo operations during recovery.
Incorrect! Try again.
49A schedule involves transactions and . writes item . reads . If aborts, must abort. This dependency is called:
A.Abort Dependency
B.Commit Dependency
C.Lock Dependency
D.View Dependency
Correct Answer: Abort Dependency
Explanation:Because read a value written by , 's validity depends on . If aborts, has consumed invalid data and must also abort.
Incorrect! Try again.
50In the context of database recovery, what does WAL stand for?
A.Write-After-Log
B.Write-Ahead-Logging
C.Wait-And-Lock
D.Write-All-Logs
Correct Answer: Write-Ahead-Logging
Explanation:Write-Ahead Logging is the protocol where log records representing a change must be written to stable storage before the changed data block is written to disk.
Incorrect! Try again.
Give Feedback
Help us improve by sharing your thoughts or reporting issues.