Please keep at least one language enabled. || కనీసం ఒక భాషను ఎంచుకోండి.
Question 1
ప్రశ్న 1
What is meant by concurrent transaction processing in a database system?
Explanation:
• Transactions are concurrent when their execution periods overlap, even though their individual operations may be interleaved by the DBMS.
• Concurrency enables a multi-user database system to process work from several users efficiently.
• Because concurrent transactions may access common data, concurrency-control mechanisms are needed to preserve correct results.
• Concurrency enables a multi-user database system to process work from several users efficiently.
• Because concurrent transactions may access common data, concurrency-control mechanisms are needed to preserve correct results.
వివరణ:
Question 2
ప్రశ్న 2
What is the primary objective of concurrency control in a multi-user database?
Explanation:
• Concurrency control coordinates overlapping database operations so that transactions do not interfere with one another incorrectly.
• It helps preserve transaction isolation and database consistency while permitting useful simultaneous access.
• Eliminating all multi-user access would defeat an important purpose of database concurrency.
• It helps preserve transaction isolation and database consistency while permitting useful simultaneous access.
• Eliminating all multi-user access would defeat an important purpose of database concurrency.
వివరణ:
Question 3
ప్రశ్న 3
A database value is 100. Transaction T1 reads 100 and plans to change it to 110. Before T1 writes, Transaction T2 also reads 100 and changes it to 120. T1 then writes 110, overwriting T2's committed value. Which concurrency problem has occurred?
Explanation:
• A lost update occurs when concurrent transactions base updates on the same earlier value and one later write overwrites the other's update.
• Here, T2's update to 120 is lost when T1 subsequently writes 110 using the stale value it had previously read.
• Concurrency-control mechanisms are intended to prevent such conflicting updates.
• Here, T2's update to 120 is lost when T1 subsequently writes 110 using the stale value it had previously read.
• Concurrency-control mechanisms are intended to prevent such conflicting updates.
వివరణ:
Question 4
ప్రశ్న 4
Transaction T1 changes an account balance from ₹10,000 to ₹8,000 but has not yet committed. Transaction T2 reads ₹8,000. T1 then rolls back, restoring ₹10,000. What did T2 perform?
Explanation:
• A dirty read occurs when one transaction reads data modified by another transaction before that modification has been committed.
• T2 observed ₹8,000 even though T1 later rolled back that change.
• Therefore T2 used a value that never became part of the committed database state.
• T2 observed ₹8,000 even though T1 later rolled back that change.
• Therefore T2 used a value that never became part of the committed database state.
వివరణ:
Question 5
ప్రశ్న 5
Transaction T1 reads an employee's Salary as ₹40,000. Transaction T2 then changes the same Salary to ₹45,000 and commits. When T1 reads that same employee row again, it obtains ₹45,000. Which concurrency phenomenon is illustrated?
Explanation:
• A nonrepeatable read occurs when a transaction reads the same row more than once and obtains different committed values because another transaction modified the row between those reads.
• T1 first reads ₹40,000 and later reads ₹45,000 from the same row.
• The intervening committed update by T2 makes T1's original read nonrepeatable.
• T1 first reads ₹40,000 and later reads ₹45,000 from the same row.
• The intervening committed update by T2 makes T1's original read nonrepeatable.
వివరణ:
Question 6
ప్రశ్న 6
Transaction T1 executes a query and finds 10 employees with Salary above ₹50,000. Transaction T2 inserts another qualifying employee and commits. T1 executes the same search again and now obtains 11 rows. Which phenomenon has occurred?
Explanation:
• A phantom read occurs when repeating a query with the same search condition returns a changed set of qualifying rows because of a concurrent committed insertion, deletion or equivalent change.
• T1 first obtains 10 qualifying rows and later 11 because T2 added another qualifying row.
• The newly appearing qualifying row is the phantom.
• T1 first obtains 10 qualifying rows and later 11 because T2 added another qualifying row.
• The newly appearing qualifying row is the phantom.
వివరణ:
Question 7
ప్రశ్న 7
Under a conventional locking-based concurrency-control system, what is generally true of a shared lock used for reading a data item?
Explanation:
• Shared locks are associated with read operations in conventional pessimistic locking systems.
• Compatible shared locks can allow several transactions to read the same resource concurrently.
• A conflicting exclusive lock for modification cannot normally be granted while incompatible shared locks remain.
• Compatible shared locks can allow several transactions to read the same resource concurrently.
• A conflicting exclusive lock for modification cannot normally be granted while incompatible shared locks remain.
వివరణ:
Question 8
ప్రశ్న 8
Which type of lock is normally associated with changing a database resource and preventing another transaction from making a conflicting simultaneous change to that resource?
Explanation:
• An exclusive lock is associated with data-modification operations in conventional locking systems.
• It prevents other transactions from obtaining incompatible access to the locked resource while the modification is protected.
• This helps prevent simultaneous conflicting updates.
• It prevents other transactions from obtaining incompatible access to the locked resource while the modification is protected.
• This helps prevent simultaneous conflicting updates.
వివరణ:
Question 9
ప్రశ్న 9
Which situation best defines a database deadlock?
Explanation:
• A deadlock occurs when transactions form a circular waiting condition over locked resources.
• Each transaction waits for another transaction to release something it requires, while itself holding a resource required by another.
• A DBMS typically detects such a condition and resolves it by terminating or rolling back one of the involved transactions.
• Each transaction waits for another transaction to release something it requires, while itself holding a resource required by another.
• A DBMS typically detects such a condition and resolves it by terminating or rolling back one of the involved transactions.
వివరణ:
Question 10
ప్రశ్న 10
What is a serial transaction schedule?
Explanation:
• In a serial schedule, transactions execute one after another without interleaving their operations.
• For example, all operations of T1 complete before T2 begins, or vice versa.
• Serial execution is conceptually simple but does not exploit the performance benefits of concurrent interleaving.
• For example, all operations of T1 complete before T2 begins, or vice versa.
• Serial execution is conceptually simple but does not exploit the performance benefits of concurrent interleaving.
వివరణ:
Question 11
ప్రశ్న 11
A concurrent schedule produces the same database effect as some valid serial ordering of the same transactions. What is such a schedule called?
Explanation:
• Serializability is a central correctness concept for concurrent transaction execution.
• A serializable schedule has an effect equivalent to executing the transactions in some serial order.
• It permits concurrency while retaining the consistency characteristics expected from an appropriate serial execution.
• A serializable schedule has an effect equivalent to executing the transactions in some serial order.
• It permits concurrency while retaining the consistency characteristics expected from an appropriate serial execution.
వివరణ:
Question 12
ప్రశ్న 12
Which ACID property is most directly connected with protecting concurrently executing transactions from improperly observing or interfering with one another's intermediate work?
Explanation:
• Isolation controls how the intermediate effects of one transaction are exposed to other concurrent transactions.
• Stronger isolation reduces the concurrency anomalies that transactions can observe.
• Atomicity concerns all-or-nothing execution, while durability concerns persistence after commit.
• Stronger isolation reduces the concurrency anomalies that transactions can observe.
• Atomicity concerns all-or-nothing execution, while durability concerns persistence after commit.
వివరణ:
Question 13
ప్రశ్న 13
Which statement best describes the general trade-off when a database uses a stronger transaction-isolation level?
Explanation:
• Stronger isolation generally protects transactions from a larger set of concurrency anomalies.
• Depending on the DBMS implementation, that protection can involve more locking, blocking, version management or transaction retries.
• Database systems therefore balance concurrency/performance requirements against consistency and isolation requirements.
• Depending on the DBMS implementation, that protection can involve more locking, blocking, version management or transaction retries.
• Database systems therefore balance concurrency/performance requirements against consistency and isolation requirements.
వివరణ:
Question 14
ప్రశ్న 14
Under the standard SQL isolation model, which isolation level permits a transaction to read changes made by another transaction that have not yet been committed?
Explanation:
• Under the SQL isolation model, READ UNCOMMITTED permits dirty reads.
• A dirty read means observing data changed by another transaction before that other transaction has committed.
• Particular database products may implement stronger behaviour than the minimum required by the standard, so the question refers specifically to the standard isolation model.
• A dirty read means observing data changed by another transaction before that other transaction has committed.
• Particular database products may implement stronger behaviour than the minimum required by the standard, so the question refers specifically to the standard isolation model.
వివరణ:
Question 15
ప్రశ్న 15
Why is keeping database transactions reasonably short generally helpful in a locking-based multi-user system?
Explanation:
• Long-running transactions can retain locks or other concurrency-control resources for longer periods.
• Completing required work and committing or rolling back promptly can reduce contention and waiting among transactions.
• Short transactions reduce risk and contention but do not guarantee that deadlocks can never occur.
• Completing required work and committing or rolling back promptly can reduce contention and waiting among transactions.
• Short transactions reduce risk and contention but do not guarantee that deadlocks can never occur.
వివరణ:
Question 16
ప్రశ్న 16
Transaction T1 locks Row A and then requests Row B. At the same time, Transaction T2 locks Row B and requests Row A. Neither transaction can proceed. Which condition is present?
Explanation:
• T1 waits for Row B, which is held by T2, while T2 waits for Row A, which is held by T1.
• This creates a circular wait in which neither transaction can continue without intervention.
• The scenario is a classic deadlock.
• This creates a circular wait in which neither transaction can continue without intervention.
• The scenario is a classic deadlock.
వివరణ:
Question 17
ప్రశ్న 17
Which statement best describes optimistic concurrency control?
Explanation:
• Optimistic concurrency assumes conflicts will be relatively uncommon and therefore avoids holding restrictive locks simply for every read.
• Before an update succeeds, the system can check whether another transaction changed the relevant data after it was read.
• A detected conflict may require the transaction to fail, roll back or retry.
• Before an update succeeds, the system can check whether another transaction changed the relevant data after it was read.
• A detected conflict may require the transaction to fail, roll back or retry.
వివరణ:
Question 18
ప్రశ్న 18
Transaction T1 reads Quantity = 25. Transaction T2 changes Quantity to 30 and commits. Without T1 performing any update, T1 later reads the same row again and obtains 30. Which phenomenon is this?
Explanation:
• Both values read by T1 can be committed values, but they differ because T2 committed an update between T1's two reads.
• This is the defining pattern of a nonrepeatable read.
• It is not a dirty read because the second value was committed before T1 observed it.
• This is the defining pattern of a nonrepeatable read.
• It is not a dirty read because the second value was committed before T1 observed it.
వివరణ:
Question 19
ప్రశ్న 19
Transaction T1 twice executes `SELECT * FROM CASES WHERE Status = 'Pending'`. Between the two executions, T2 inserts and commits a new row whose Status is 'Pending'. The second query therefore returns an additional row. What has T1 experienced?
Explanation:
• The same search condition produces a different set of qualifying rows because another transaction committed a new matching row.
• This is the standard definition of a phantom read.
• Unlike a nonrepeatable read, the important change is in the set of rows satisfying the query rather than merely a changed value in one previously read row.
• This is the standard definition of a phantom read.
• Unlike a nonrepeatable read, the important change is in the set of rows satisfying the query rather than merely a changed value in one previously read row.
వివరణ:
Question 20
ప్రశ్న 20
Match List I with List II:
List I
(a) Lost update
(b) Dirty read
(c) Pessimistic concurrency control
(d) Optimistic concurrency control
List II
1. Uses locking to prevent conflicting operations before they occur
2. Reads data changed by another transaction before that change is committed
3. Checks for conflicting changes and may reject or retry an update
4. One transaction's update is overwritten by another transaction
Choose the correct matching code.
List I
(a) Lost update
(b) Dirty read
(c) Pessimistic concurrency control
(d) Optimistic concurrency control
List II
1. Uses locking to prevent conflicting operations before they occur
2. Reads data changed by another transaction before that change is committed
3. Checks for conflicting changes and may reject or retry an update
4. One transaction's update is overwritten by another transaction
Choose the correct matching code.
Explanation:
• Lost update corresponds to one update overwriting another, giving (a)-4, while dirty read means reading uncommitted data, giving (b)-2.
• Pessimistic concurrency uses locking to prevent conflicts in advance, giving (c)-1.
• Optimistic concurrency checks whether conflicting changes occurred and can require retry or rollback, giving (d)-3.
• Pessimistic concurrency uses locking to prevent conflicts in advance, giving (c)-1.
• Optimistic concurrency checks whether conflicting changes occurred and can require retry or rollback, giving (d)-3.
వివరణ:
Answer Key సమాధానాల పట్టిక
-
Question 1 ప్రశ్న 1Answer: C. Allowing two or more transactions to have overlapping execution periods సమాధానం: C.
-
Question 2 ప్రశ్న 2Answer: A. To coordinate simultaneous transactions so that their interaction does not produce incorrect or inconsistent database results సమాధానం: A.
-
Question 3 ప్రశ్న 3Answer: D. Lost update సమాధానం: D.
-
Question 4 ప్రశ్న 4Answer: B. A dirty read సమాధానం: B.
-
Question 5 ప్రశ్న 5Answer: B. Nonrepeatable read సమాధానం: B.
-
Question 6 ప్రశ్న 6Answer: D. Phantom read సమాధానం: D.
-
Question 7 ప్రశ్న 7Answer: A. Multiple transactions may normally hold compatible shared locks on the same item, while a conflicting exclusive modification is prevented. సమాధానం: A.
-
Question 8 ప్రశ్న 8Answer: C. Exclusive lock సమాధానం: C.
-
Question 9 ప్రశ్న 9Answer: D. Two or more transactions wait indefinitely for resources held by one another so that none of them can proceed. సమాధానం: D.
-
Question 10 ప్రశ్న 10Answer: B. A schedule in which one transaction completes before the next transaction begins its database operations సమాధానం: B.
-
Question 11 ప్రశ్న 11Answer: C. Serializable schedule సమాధానం: C.
-
Question 12 ప్రశ్న 12Answer: A. Isolation సమాధానం: A.
-
Question 13 ప్రశ్న 13Answer: A. It generally provides greater protection against concurrency anomalies, but may increase blocking, resource use or transaction conflicts. సమాధానం: A.
-
Question 14 ప్రశ్న 14Answer: C. READ UNCOMMITTED సమాధానం: C.
-
Question 15 ప్రశ్న 15Answer: B. It can reduce the time locks are held and therefore reduce contention with other transactions. సమాధానం: B.
-
Question 16 ప్రశ్న 16Answer: D. Deadlock సమాధానం: D.
-
Question 17 ప్రశ్న 17Answer: C. Transactions can proceed without locking data merely for reading, and conflicts are checked when an update or completion is attempted. సమాధానం: C.
-
Question 18 ప్రశ్న 18Answer: A. Nonrepeatable read సమాధానం: A.
-
Question 19 ప్రశ్న 19Answer: D. Phantom read సమాధానం: D.
-
Question 20 ప్రశ్న 20Answer: B. (a)-4, (b)-2, (c)-1, (d)-3 సమాధానం: B.
