Home › Blog › DBMS interview questions: keys, normalisation, transactions and indexes

DBMS interview questions: keys, normalisation, transactions and indexes

DBMS interviews cover the theory behind databases: keys and relationships, normalisation, joins, transactions and ACID properties, isolation levels and their anomalies, indexing, concurrency control, and the trade-offs between relational and NoSQL systems. Campus interviews emphasise definitions and normal forms; backend interviews emphasise transactions, isolation and indexes, because those explain real bugs and slow queries.

Fifteen common DBMS interview questions

  1. What are primary, candidate, super, foreign and composite keys?
  2. Explain 1NF, 2NF, 3NF and BCNF.
  3. What are the types of joins?
  4. What does ACID stand for?
  5. What are the isolation levels, and which anomalies does each prevent?
  6. What is a dirty read, a non-repeatable read and a phantom read?
  7. How does an index work? Clustered versus non-clustered?
  8. When can an index hurt performance?
  9. What is a deadlock in a database, and how is it resolved?
  10. Optimistic versus pessimistic locking?
  11. DELETE versus TRUNCATE versus DROP?
  12. What are views and stored procedures?
  13. What is denormalisation, and when is it justified?
  14. SQL versus NoSQL?
  15. What does the CAP theorem say?

Keys and normalisation

Transactions and isolation

Isolation levelPreventsStill allows
Read uncommitted—Dirty, non-repeatable and phantom reads
Read committedDirty readsNon-repeatable and phantom reads
Repeatable readDirty and non-repeatable readsPhantoms (in the standard definition)
SerializableAll three— (at a concurrency cost)

ACID: atomicity (all or nothing), consistency (constraints hold), isolation (concurrent transactions don't interfere improperly) and durability (committed data survives crashes, via write-ahead logging). Real databases implement isolation differently — many use multi-version concurrency control so readers don't block writers — so mention that behaviour varies by engine. See PostgreSQL interview questions.

Indexes

Most indexes are B-trees that keep keys sorted, making lookups, range scans and ordering fast. A clustered index determines the physical order of rows (one per table); non-clustered indexes are separate structures pointing to rows. Indexes speed reads but slow inserts and updates and use storage, and they may be ignored for low-selectivity columns or when queries wrap the column in a function. Composite indexes follow the leftmost-prefix rule: an index on (a, b) helps queries on a, or a and b, but not on b alone.

How deep it goes by level

Freshers are usually asked definitions with a small example: keys, normal forms, joins and ACID. Mid-level backend candidates get scenario questions — a report shows different totals on refresh, a query became slow after a data migration, two users booked the same seat — and are expected to reason with isolation levels, indexes and locks. Senior candidates are asked about replication lag, partitioning, choosing between relational and NoSQL stores for a workload, and how to change a schema on a live system without downtime. Prepare one real story at your level, because “tell me about a database problem you solved” follows most theory questions.

Concurrency and NoSQL

Practising

Reading answers is not the same as saying them. Pick ten of the questions above and answer them aloud against a timer; a free AI interview assistant like CoPilot Interview can ask database questions in a mock interview and flag answers that ran long or lacked an example. Write the SQL for each join type once and explain the result aloud; then see SQL interview questions and data modeling questions.

Disclosure: CoPilot Interview is our product, so weigh what we say about it accordingly. Everything else on this page applies whichever tool you use, or none.

Frequently asked questions

What are the ACID properties?

Atomicity, consistency, isolation and durability: transactions complete fully or not at all, keep data valid, don't interfere improperly with each other, and persist once committed.

What is the difference between 2NF and 3NF?

2NF removes partial dependencies on part of a composite key. 3NF additionally removes transitive dependencies, where a non-key column depends on another non-key column.

Clustered or non-clustered index?

A clustered index defines the physical order of the table's rows, so there is one per table. Non-clustered indexes are separate structures pointing to rows, and a table can have many.

What is a phantom read?

When a transaction re-runs a query and finds new rows that another committed transaction inserted in the meantime.

Practise on real interview questions

Run 145 real interview questions across 10 tracks, answer out loud and see a structured answer to compare with yours. Free, no signup.

Try a practice question