DBMS 80/20 Cheat Sheet: Core Concepts for UCS3001
Master keys, ER-to-table mapping, normal forms, SQL joins, ACID transactions and serializability; these ideas connect nearly every DBMS exam question.
Core Principles
- Schema = blueprint; instance = current data contents
- Three-schema architecture: external, conceptual, internal levels
- Physical independence: change storage without changing logical schema
- Logical independence: change conceptual schema without changing user views
- 2NF: remove partial dependency; 3NF: remove transitive dependency of non-prime attributes
- BCNF: every non-trivial FD determinant must be a super key
- Conflict serializable: precedence graph acyclic → equivalent serial order
- Strict schedule ⊂ cascadeless ⊂ recoverable
Action Steps
- Compute attribute closure of each candidate determinant (finds keys)
- Check each FD's determinant against BCNF rule (must be super key)
- Decompose violating FD into X ∪ Y and R − Y (lossless split)
- Draw precedence graph: edge Ti→Tj for each conflicting pair (serializability)
- Verify no cycle; topological sort gives equivalent serial order
- Write WHERE before UPDATE/DELETE to avoid whole-table changes
Formulas
- Closure test: $$X^+ = X \cup \{A : X \to A \text{ derivable}\}$$ ; X is super key if $$X^+ = R$$
- Armstrong: $$X\to Y \Rightarrow XZ \to YZ$$ (augmentation)
Key Terms
- Armstrong's axioms: Reflexivity, augmentation, transitivity; sound and complete rules for deriving functional dependencies.
- WAL: Write-ahead logging: log record reaches stable storage before the changed data page is written.
- MVCC: Keeps multiple data versions so readers see consistent snapshots without blocking writers.
- 2PL: Two-phase locking: growing phase acquires locks, shrinking phase releases; guarantees conflict serializability.
- Intention lock: Signals a transaction plans to lock lower-level items (IS, IX, SIX) in multiple granularity locking.
Pro Tips
- Use IS NULL, not = NULL: comparisons with NULL return UNKNOWN, dropping rows silently
- Binary decomposition is lossless if R1∩R2 determines all of R1 or all of R2
- Ternary relationships: splitting into binaries can lose which supplier supplied which part
- Every conflict-serializable schedule is view-serializable, not vice versa
Pitfalls to Avoid
- Writing HAVING for row filters: use WHERE; HAVING runs after grouping, costs speed
- Replacing ternary relationship with binaries loses combination meaning
- Ignoring BCNF dependency preservation: BCNF may lose original FDs
- Confusing lock-based waiting with timestamp rollbacks: timestamps abort and restart transactions
Myth vs Reality
- The 80/20 rule guarantees good exam marks.: The guide calls it a study strategy only: it prioritises high-value concepts but guarantees no marks.
- Read-read operations create serializability conflicts.: Only pairs with at least one write on the same item, from different transactions, conflict.
Real World Examples
- Bank transfer of 500 from Account A to B: Wrap both UPDATEs in BEGIN…COMMIT so both succeed or both roll back (atomicity).
- STUDENT(StudentID, DeptID, DeptName) with transitive DeptID→DeptName: Split into STUDENT(StudentID, DeptID) and DEPARTMENT(DeptID, DeptName) to reach 3NF.
Statistics
- Syllabus hours per unit (5 units): 8 hours each, 40 total
- Suggested self-study plan: 7 sessions
- Bank transfer example amount: 500 from Account A to B
Related cheat sheets
More like this