Unit summary

A transaction is a unit of work with ACID properties. Concurrent schedules need control: shared and exclusive locks, two-phase locking, serializability by precedence graph, recoverability and deadlock handling. A write-ahead log supports crash recovery. Data is stored in files (heap, sorted, hashed) and found faster with indexes (clustered, non-clustered, B+ tree, hash). Choose indexes for WHERE, join and ORDER BY columns with high selectivity, and check the query plan.

Glossary

Term Meaning
Transaction A group of operations that run as one unit
ACID Atomicity, consistency, isolation, durability
Schedule Order in which operations of transactions run
Shared lock Lock for reading
Exclusive lock Lock for writing
2PL Locking protocol with growing and shrinking phases
Deadlock Transactions waiting on each other forever
Index Structure that finds rows quickly
B+ tree Balanced tree index with linked leaves
Selectivity How many different values a column has

Question bank

Short answer questions

  1. Define ACID properties.
  2. Differentiate shared and exclusive lock.
  3. What is a deadlock?
  4. What is a clustered index?
  5. State two guidelines for index selection.

Long answer questions

  1. Explain ACID with an example.
  2. Explain two-phase locking and serializability.
  3. Explain deadlock prevention and detection.
  4. Explain file organizations and index types.
  5. Explain index selection with examples.

Sources

  • Official BCA syllabus Database Management Systems, course code CC202, Unit III