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
- Define ACID properties.
- Differentiate shared and exclusive lock.
- What is a deadlock?
- What is a clustered index?
- State two guidelines for index selection.
Long answer questions
- Explain ACID with an example.
- Explain two-phase locking and serializability.
- Explain deadlock prevention and detection.
- Explain file organizations and index types.
- Explain index selection with examples.
Sources
- Official BCA syllabus Database Management Systems, course code CC202, Unit III
