TIMED REVISION · 1-MINUTE PANIC SHEETS

Database Management Systems 10-Minute Rapid Revision

For the last few minutes before the exam hall: one core rule per topic, the formulas you must remember, and the traps that cost marks.

PANIC SHEET 01 · Database Architecture & The Three-Schema Framework

Why DBMS Exists: File Systems vs DBMS & The Three-Schema Architecture

Full Lesson →
CORE INVARIANT ANCHOR:

“Three-Schema Levels: External (Views) → Conceptual (Logical Schema) → Internal (Physical Storage).”

Must-Remember Principles:
  • —Physical Data Independence: Alter index, file layout, block format without touching conceptual schema.
  • —Logical Data Independence: Add table, split columns without breaking existing views.
  • —DDL defines conceptual tables; DSDL defines storage; DML queries data; DCL manages permissions; TCL manages transactions.
Critical Exam Pitfalls:
  • —Physical data independence is much easier to maintain than logical data independence.
  • —File systems manage bytes and files; DBMS engines manage typed relations, constraints, and ACID transactions.
PANIC SHEET 02 · Entity-Relationship & Relational Schema Mapping

ER & Extended ER Modeling: Constraints, Weak Entities & Minimum Tables

Full Lesson →
CORE INVARIANT ANCHOR:

“Weak Entity Key = Identifying Owner PK + Discriminator. Double diamond relationship is always subsumed into weak entity table.”

Must-Remember Principles:
  • —M:N relationship → strictly 3 tables.
  • —1:N relationship with total on N-side → 2 tables (merge R into N-side).
  • —1:1 relationship with total on both sides → 1 table.
  • —Weak entity + identifying owner → 2 tables.
Critical Exam Pitfalls:
  • —Multivalued attributes ALWAYS require their own separate table with foreign key to owner.
  • —A partial key cannot identify a tuple across the database by itself.
PANIC SHEET 03 · Relational Model, Relational Algebra & Calculus

Relational Algebra, Tuple Calculus & The Division Operator

Full Lesson →
CORE INVARIANT ANCHOR:

“Selection filters rows; Projection extracts columns; Cartesian Product multiplies cardinalities; Division answers FOR ALL queries.”

Must-Remember Principles:
  • —deg(R × S) = deg(R) + deg(S); card(R × S) = |R| × |S|.
  • —Natural Join R(m) ⋈ S(n) with FK = exactly m tuples.
  • —General Natural Join R(m) ⋈ S(n) bounds = [0, m × n].
  • —Division R(A, B) ÷ S(B) yields tuples in A associated with EVERY tuple in S.
Critical Exam Pitfalls:
  • —Projection removes duplicates in pure relational algebra; SQL SELECT does NOT unless DISTINCT is specified.
  • —Natural join on disjoint sets of common attribute values yields an empty relation.
PANIC SHEET 04 · SQL Mastery, 3-Valued Logic & Complex Subqueries

SQL Mastery: 3-Valued Logic, Aggregates & Correlated Subqueries

Full Lesson →
CORE INVARIANT ANCHOR:

“WHERE requires TRUE to keep rows; UNKNOWN and FALSE are both discarded. (col = NULL) is always UNKNOWN.”

Must-Remember Principles:
  • —NOT IN with any NULL in subquery returns 0 rows! Always prefer NOT EXISTS.
  • —COUNT(*) counts all rows; COUNT(col) counts only non-null values.
  • —Execution order: FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY.
  • —WHERE filters raw rows; HAVING filters grouped aggregates.
Critical Exam Pitfalls:
  • —Never write WHERE col = NULL; write WHERE col IS NULL.
  • —Column aliases created in SELECT cannot be referenced in WHERE.
PANIC SHEET 05 · Functional Dependencies & Normalization (1NF to BCNF)

Functional Dependencies, Candidate Keys & Normal Forms (1NF to BCNF)

Full Lesson →
CORE INVARIANT ANCHOR:

“2NF = No Partial Dependency; 3NF = LHS Superkey OR RHS Prime; BCNF = LHS must be Superkey.”

Must-Remember Principles:
  • —Superkey count with single key size k: 2^(n - k).
  • —Lossless condition: (R1 ∩ R2) → R1 or (R1 ∩ R2) → R2.
  • —3NF always guarantees dependency preservation; BCNF may lose dependencies.
  • —Attributes that never appear on the RHS of any FD MUST be in every candidate key.
Critical Exam Pitfalls:
  • —A partial dependency only exists when a PROPER SUBSET of a key determines a non-prime attribute.
  • —If all candidate keys are single attributes, 2NF is automatically satisfied!
PANIC SHEET 06 · Storage, Indexing & B/B+ Trees

B & B+ Trees, Multi-Level Indexing & Disk I/O Arithmetic

Full Lesson →
CORE INVARIANT ANCHOR:

“B+ Tree: Keys only in internal nodes; keys + data pointers in leaves; leaves linked horizontally.”

Must-Remember Principles:
  • —Internal order inequality: p · Pb + (p - 1) · K ≤ B.
  • —Leaf order inequality: m · (K + Pr) + Pb ≤ B.
  • —Min keys non-root internal: ⌈p/2⌉ - 1. Min keys non-root leaf: ⌈m/2⌉.
  • —Root min keys: 1 key (2 pointers). Max keys: p - 1.
  • —Disk I/Os for search = Height + 1 (Height index blocks + 1 data block).
Critical Exam Pitfalls:
  • —In internal nodes, pointers are p and keys are p - 1; in leaf nodes, pointers and keys are both m (plus 1 next block pointer).
  • —Range queries in B+ Trees do not traverse back up to the root; they walk horizontally along the leaf pointers.
PANIC SHEET 07 · Transactions & Concurrency Control

ACID Invariants, Precedence Graphs & Conflict Serializability

Full Lesson →
CORE INVARIANT ANCHOR:

“Conflicting pair = Same item, different tx, AT LEAST ONE WRITE. Cycle in precedence graph = NOT Conflict Serializable.”

Must-Remember Principles:
  • —Precedence Graph: Ti → Tj if Ti does conflicting op before Tj.
  • —Acyclic graph? Topological sort gives equivalent serial schedule!
  • —Recoverable: Ti commits before Tj commits (where Tj reads from Ti).
  • —Cascadeless: Ti commits before Tj READS from Ti.
  • —Strict: Ti commits before Tj reads OR writes X.
Critical Exam Pitfalls:
  • —Two READ operations on the same data item never conflict with each other.
  • —A schedule can be conflict serializable but still non-recoverable!
PANIC SHEET 08 · Concurrency Protocols, Deadlocks & Crash Recovery

Two-Phase Locking (2PL), Timestamp Ordering & Write-Ahead Logging

Full Lesson →
CORE INVARIANT ANCHOR:

“Strict 2PL holds write locks until commit (cascadeless). Conservative 2PL pre-claims all locks (deadlock-free). WAL flushes log before dirty pages.”

Must-Remember Principles:
  • —Wait-Die: Old waits, Young dies (non-preemptive).
  • —Wound-Wait: Old wounds young, Young waits (preemptive).
  • —Committed before crash? REDO. Uncommitted before crash? UNDO.
  • —Strict 2PL guarantees Cascadelessness and Strict Recoverability, but NOT Deadlock freedom.
Critical Exam Pitfalls:
  • —Deadlocks can still occur in Strict 2PL and Rigorous 2PL!
  • —Redo requires the log's AFTER-image; Undo requires the log's BEFORE-image.
PANIC SHEET 09 · Data Warehousing & Multidimensional Modeling

Data Warehousing, Multidimensional OLAP Models & Star/Snowflake Schemas

Full Lesson →
CORE INVARIANT ANCHOR:

“Data Warehouses separate analytical OLAP workloads from transactional OLTP. Fact tables hold numeric additive measures; Dimension tables hold descriptive hierarchies. Star schema denormalizes dimensions; Snowflake schema normalizes dimensions into BCNF/3NF.”

Must-Remember Principles:
  • —OLTP vs OLAP: OLTP is write-heavy, 3NF/BCNF normalized, row-oriented, ACID transactional. OLAP is read-heavy, star/snowflake denormalized, column-oriented, analytical aggregate queries.
  • —Fact Table: Contains composite primary key (concatenation of foreign keys to all dimension tables) and numerical measures (additive e.g. sales, semi-additive e.g. bank balance, non-additive e.g. unit price/ratios).
  • —Star Schema: Single central fact table directly referencing completely denormalized, un-normalized dimension tables (simple queries, fast joins, higher data redundancy).
  • —Snowflake Schema: Dimension tables are normalized into sub-dimension hierarchies (e.g., Item -> Brand -> Category). Reduces redundancy, but requires multi-table joins.
  • —Fact Constellation (Galaxy Schema): Multiple fact tables sharing common conformed dimension tables (e.g., Sales Fact and Shipping Fact sharing Date and Store dimensions).
  • —OLAP Operations: (1) Roll-up (aggregation/climbing hierarchy e.g. day -> month), (2) Drill-down (disaggregation/descending hierarchy e.g. quarter -> month), (3) Slice (fixing one dimension e.g. Time = '2024'), (4) Dice (sub-cube selection along multiple dimensions), (5) Pivot (rotating cube axes).
  • —OLAP Architectures: ROLAP (Relational OLAP, star schemas in RDBMS), MOLAP (Multidimensional OLAP, pre-computed dense arrays/tensors), HOLAP (Hybrid OLAP, detailed data in ROLAP, aggregated summaries in MOLAP).
Critical Exam Pitfalls:
  • —A measure cannot be added across dimensions if it is non-additive (e.g., averaging percentages or profit margins across stores requires recomputing numerator and denominator).
  • —Snowflake schema reduces storage redundancy compared to Star schema, but degrades query performance due to additional JOIN operations.
PANIC SHEET 10 · Data Warehousing & Multidimensional Modeling

Data Transformations: Normalization, Discretization, Sampling & Compression

Full Lesson →
CORE INVARIANT ANCHOR:

“Match the transformation to the goal; preserve assumptions and account for information loss and leakage.”

Must-Remember Principles:
  • —Min-max: a+(x-min)(b-a)/(max-min)
  • —Z-score: (x-μ)/σ
  • —Compression ratio: original/compressed size
  • —Simple random sample inclusion probability: n/N
Critical Exam Pitfalls:
  • —Zero range or zero variance
  • —Training/test leakage
  • —Wrong bin boundary convention
  • —With versus without replacement
  • —Lossy versus lossless
  • —Database normal forms versus feature scaling