DBMS is the most predictable interview section โ the same five topics, every company. Master these and the round is free marks.
Normalization without the textbook fog
- 1NF: atomic cells โ no "Maths, Physics" comma lists in one column
- 2NF: no partial dependency โ every non-key column depends on the WHOLE composite key
- 3NF: no transitive dependency โ columns depend on the key only, not on other non-key columns (student โ dept โ dept_hod? move hod to a depts table)
- One-liner: "Each fact stored once โ updates can't create contradictions"
ACID with a bank transfer
- Atomicity: debit + credit both happen or neither
- Consistency: total money unchanged after
- Isolation: concurrent transfers don't see each other's half-states
- Durability: committed = survives a crash
Indexes
A sorted lookup structure (B-tree) making reads O(log n) instead of full scans โ at the cost of slower writes and storage. "Index columns you WHERE/JOIN on; don't index everything."
Rapid-fire bank
- DELETE (row-wise, WHERE, rollback-able) vs TRUNCATE (all rows, fast, no WHERE) vs DROP (table gone)
- Primary key (unique + not null, one per table) vs unique key (nulls allowed)
- WHERE filters rows; HAVING filters groups after GROUP BY