Posts for: #DBMS

dbms- file_structure

B-Tree

🌳 B-Tree Nomenclature

  • Order (m) → max children = m
  • Max keys → m − 1
  • Min keys (non-root) → ⌈m/2⌉ − 1
  • Children vs Keys → keys = children − 1
  • Root → minimum 1 key
  • Internal node → has children
  • Leaf node → no children
  • All leaves → same level (balanced)
  • Height → O(logₘ n) Image Description

Insert Operation

Image Description

Insert Operation another example

B-Tree of Order 5 Insert Keys 7, 4, 14, 25, 3, 10, 12, 15, 17, 9, 29, 1, 38, 2, 11
Image Description Image Description Image Description Image Description

Read more →

dbms- transaction

Definition

A transaction in DBMS is a finite sequence of database operations that is executed as one logical unit of work, meaning either all operations are performed successfully or none are performed.

-- Example for "logical unite of work"
Read(A)
A = A − 100
Write(A)
Read(B)
B = B + 100
Write(B)
Commit

A transaction must satisfy the ACID properties to ensure database correctness and consistency.

Image Description


Key Points

  • A transaction groups multiple database operations into a single logical task
  • Partial execution is not allowed
  • Failure of any operation causes the entire transaction to rollback
  • Ensures reliability in concurrent and failure-prone environments

ACID Properties (Overview)

  • Atomicity – All operations execute or none execute
  • Consistency – Database remains in a valid state
  • Isolation – Transactions do not interfere with each other
  • Durability – Committed changes persist permanently

Schedule

A schedule is the execution order of operations of multiple transactions on the same database, possibly executed concurrently.

Read more →