Interviews
10 DBMS Interview Questions You Should Master in 2026
Ace your next interview with the 10 most common DBMS interview questions, covering ACID, normalization, indexing, joins, and recovery with sample answers.
Interview Pilot Editorial Team
Updated November 8, 2026
18 min read

If you were asked right now why a bank transfer either completes fully or not at all, could you name the mechanism behind it, not just the ACID property? Saying atomicity is a start. Explaining transaction boundaries, rollback, and recovery is what makes the answer convincing.
Candidates fumble DBMS interview questions when they memorize definitions without understanding implementation. An interviewer can expose that gap with a follow-up about a crash between updates, then another about concurrent withdrawals. Suddenly, a familiar banking example becomes a test of engineering judgment.
That foundation is worth practicing. In the Stack Overflow 2025 Developer Survey, SQL was used by 58.6% of respondents, making it relevant preparation across software, analytics, and data roles. Learn transferable concepts before spending your preparation time on vendor-specific syntax.
The ten questions below pair each concept with the trap behind it, the follow-up probes you should expect, and a 60-second answer structure you can rehearse. Treat that time limit as a practice constraint, not a script you must deliver word for word.
A strong answer connects a guarantee to a mechanism, demonstrates it with an example, and names the trade-off.
Speak your answers aloud. Then change the scenario, introduce a failure, or challenge an assumption. If your explanation only works for the example you memorized, you're not ready for the follow-up.
1. ACID Properties
A bank transfer needs more than two successful UPDATE statements. The debit and credit must belong to the same transaction, with explicit handling for failure.

Explain atomicity as all-or-nothing execution, consistency as preserving declared constraints and application invariants, isolation as controlling concurrent interactions, and durability as preserving committed changes through supported failures. Don't claim every isolation level makes transactions behave as though they ran serially. That's the stronger guarantee of serializable execution.
What the Interviewer Probes
A weak answer expands the acronym and stops. A stronger answer connects atomicity to rollback and recovery, durability to durable logging under the configured commit policy, and isolation to locking, multiversion concurrency control, or conflict detection.
Expect questions about a crash after the debit, a simultaneous withdrawal, and whether database constraints alone can enforce every business rule. Consistency doesn't mean the database automatically understands that money must be conserved.
Your 60-second structure: Start with the transfer invariant, explain each property through that example, then name the implementation mechanisms. Finish with a boundary: a database transaction doesn't automatically make an external payment API call atomic.
That boundary matters. If the transfer also sends a notification, explain how an outbox can record the notification intent within the transaction without pretending the message delivery itself is part of the database commit.
2. Database Normalization (1NF to BCNF)
Question: How would you normalize an orders table that repeats customer details on every order?
Start with the anomaly. Updating a customer's current address across many order rows creates opportunities for inconsistent records. Separating customers from orders removes that duplication, but a historical shipping address may legitimately belong to the order.

- First normal form: Use atomic values within the chosen domain and avoid repeating groups.
- Second normal form: Remove dependencies of non-prime attributes on only part of a candidate key.
- Third normal form: For each nontrivial functional dependency, the determinant is a superkey or the dependent attribute is prime.
- BCNF: Require every determinant of a nontrivial functional dependency to be a superkey.
A weak answer says normalization means splitting large tables. The interviewer wants you to identify functional dependencies, not divide tables by appearance.
For a BCNF follow-up, consider a teaching relation containing student, course, and instructor. If instructors determine courses, while student-course and student-instructor are candidate keys, the instructor dependency can satisfy third normal form but violate BCNF.
Your 60-second structure: Identify the business dependency, demonstrate an update anomaly, describe the decomposition, and explain how joins reconstruct the information. Close with the trade-off: denormalized reporting tables can simplify reads, but someone must own refresh logic, freshness expectations, and reconciliation.
3. Keys in DBMS (Primary, Candidate, Foreign, Super, Surrogate)
An employee table has employee_id, a mandatory unique employee_number, and department_id. Which columns are keys, and why?
Candidate keys are minimal sets of attributes that uniquely identify rows. Either employee identifier could qualify; the primary key is the candidate key you choose as the principal identifier. A superkey also identifies rows uniquely, but may contain unnecessary attributes.
Explain the Design, Not Just the Vocabulary
A generated employee_id is a surrogate key because it has no business meaning. A department_id foreign key can reference a qualifying unique key in the departments table, not only its primary key. Foreign keys can also reference the same table, as with an employee's manager.
A weak answer says every unique column is a primary key or that a surrogate key prevents business duplicates. It doesn't. You still need a uniqueness constraint on the employee number if duplicate numbers are invalid.
Expect probes about nullable unique columns, changing natural keys, and deletion behavior. Primary keys disallow NULL; unique-constraint treatment of NULL depends on the database.
Your 60-second structure: Define uniqueness, distinguish minimal candidate keys from broader superkeys, select a primary key, and explain the foreign-key relationship. Then justify the surrogate identifier's stability.
For a many-to-many relationship, use an employee-project junction table. A composite key on employee and project can prevent duplicate assignments, unless the business model allows separate assignment periods that need their own identity.
4. Indexing, B-Trees, B+ Trees, and Hash Indexes
Question: A customer-order lookup is slow. Would you add an index?
Not until you understand the query and its execution plan. B-tree-family indexes support ordered access, equality predicates, and ranges; B+ trees keep data entries at leaf level, with linked leaves supporting ordered traversal. Hash indexes target equality lookups rather than ordered range access.

For orders filtered by customer and sorted by creation time, consider a composite index on (customer_id, created_at). Explain how the leading column affects usable access paths rather than treating the leftmost-prefix rule as a complete description of every optimizer.
A weak answer says indexes always make queries faster. Follow-ups will test selectivity, write overhead, storage, and why a sequential scan might be cheaper.
Rehearse an Evidence-Led Answer
Your 60-second structure: State the query pattern, capture a baseline, inspect EXPLAIN, compare estimated and actual row counts, propose an index, and measure again. EXPLAIN ANALYZE executes the statement, so use particular care with writes and production workloads.
Cardinality estimates matter: a VLDB study discussing PostgreSQL's Join Order Benchmark reports that roughly 10% of queries failed to complete in a reasonable timeframe under cardinality-estimation errors.
Distinguish clustered storage from a separate secondary index using a named engine, such as InnoDB. Close by measuring write cost and plan stability, not just the improved read latency.
5. SQL Joins (Inner, Outer, Cross, Self)
The trap isn't remembering a Venn diagram. It's predicting which rows survive.
Suppose you need every customer, plus any paid orders they've placed. A LEFT JOIN preserves customers without matching orders, but putting orders.status = 'paid' in WHERE rejects their null-extended rows. Put that condition in ON when unmatched customers must remain.
- Inner join: Return matching combinations.
- Outer joins: Preserve unmatched rows from the left, right, or both sides, depending on the join.
- Cross join: Return every combination of rows.
- Self join: Reference the same table through separate aliases, such as employees and managers.
A weak answer names the join types without discussing multiplicity. If a customer has several matching orders, the customer appears in several result rows. Adding DISTINCT without understanding why isn't a reliable correction.
Predict Before You Execute
Expect follow-ups about duplicate join keys, missing relationships, and whether the requested output is customer-level or order-level. Use the data analyst technical interview questions and answers to practice that shift from syntax to analytical intent.
Your 60-second structure: State the output grain, identify the preserved side, explain the matching predicate, and predict duplication and NULL behavior. Finish with a tiny test containing an unmatched customer and a customer with multiple orders.
For an employee-manager query, use a self LEFT JOIN if employees without managers must remain. Explain that choice before writing the query.
6. Transaction Isolation Levels and Concurrency Problems
Two sessions both observe an available airline seat. What prevents them from selling it twice?
Use the isolation chart as a starting point, then explain the engine's actual behavior.

Read Uncommitted permits dirty reads in the standard model. Read Committed prevents dirty reads but can permit changing results between statements; Repeatable Read also prevents non-repeatable reads, while phantom behavior depends on implementation. Serializable requires an outcome equivalent to some serial execution.
A weak answer equates snapshot isolation with serializability. Snapshot isolation can still permit write skew when transactions modify different rows after reading a shared condition.
Choose the invariant first. Then choose the isolation level, constraints, locks, and retry behavior needed to preserve it.
In workload-specific evaluations, TxnSails reported up to a 4.8× improvement over PostgreSQL's serializable implementation. That's evidence that scheduling choices matter, not a promise that weakening isolation improves every application.
Your 60-second structure: Define the anomaly, walk through overlapping transactions, identify the violated invariant, and propose protection. For seat booking, that might include a uniqueness constraint or an atomic conditional update, with retries where required.
Use these advanced SQL interview questions to rehearse concurrency follow-ups. Track committed throughput, tail latency, serialization failures, and retries before recommending an isolation change.
For another explanation of isolation behavior, use this video.
7. Deadlocks and Concurrency Control
Transaction A locks an account row and requests an inventory row. Transaction B already holds that inventory row and requests the account row. Neither can proceed without intervention.
That's a deadlock, not merely a slow query or ordinary blocking. The Coffman conditions are mutual exclusion, hold and wait, no preemption, and circular wait.
Separate Detection From Prevention
Databases can detect cycles in a wait-for graph and abort a victim transaction. The application must handle that failure safely, rather than assume the database will complete the operation.
A weak answer recommends increasing the timeout. A longer timeout doesn't remove the circular dependency, and a timeout error alone doesn't prove a deadlock occurred.
Expect follow-ups about consistent lock ordering, transaction length, and retry safety. Two-phase locking governs lock acquisition and release; it does not eliminate deadlocks by itself. Timestamp-based ordering schemes provide a different way to control conflicting operations, potentially requiring aborts.
Your 60-second structure: Draw the lock cycle, distinguish blocking from deadlock, explain victim rollback, and propose a consistent acquisition order. Finish with bounded retries and idempotency protection for externally visible operations.
For example, every transfer path can lock account rows in the same identifier order. Keep network calls outside the locked transaction where the design permits, and inspect deadlock reports before changing isolation.
The same resource-cycle reasoning appears in operating system interview questions, but database answers must also address rollback and transaction retries.
8. Database Recovery and Write-Ahead Logging
Question: The database acknowledges a commit, then crashes before every modified data page reaches disk. How can the committed change survive?
Write-ahead logging, or WAL, separates durable change records from later data-page writes. The relevant log records must reach stable storage before the corresponding changed pages are flushed. Under a durable commit policy, sufficient commit information must also be persisted before success is acknowledged.
A weak answer says the database restores its latest backup. That skips crash recovery and confuses routine restart behavior with disaster recovery.
- Analysis: In ARIES-style recovery, establish transaction and dirty-page state.
- Redo: Repeat logged history where necessary.
- Undo: Roll back incomplete transactions using the recovery scheme's rules.
These are ARIES concepts, not a claim that every engine implements identical phases. PostgreSQL uses WAL for recovery, but its treatment of uncommitted changes shouldn't be described as a universal ARIES-style physical undo pass.
Walk Through the Crash
Your 60-second structure: Describe a logged update, durable commit, delayed data-page flush, and crash. Explain how recovery uses the durable log, then distinguish an incomplete transaction from a committed one.
Expect probes about checkpoints, log retention, and point-in-time recovery. Checkpoints reduce recovery work; they aren't substitutes for backups.
Backups, archived logs, and replication address complementary risks. Connect operational monitoring to database alert routing and runbook actions, then explain who validates restores and how the team knows recovered data is usable.
9. DBMS vs. RDBMS and SQL vs. NoSQL
Start by correcting the categories: an RDBMS is a type of DBMS. SQL is a language, while NoSQL describes a broad collection of systems rather than one storage model or consistency guarantee.
A relational system organizes data through relations and supports constraints and relational operations. NoSQL systems include document, key-value, wide-column, and graph databases, each with different access patterns and operational trade-offs.
A weak answer says NoSQL is always faster, relational databases can't scale, or document databases have no schema. Applications still depend on document structure, even when the database permits flexible records.
Start with queries, invariants, and failure requirements. Don't choose a database from a slogan.
Your 60-second structure: Define the categories, state the workload, compare plausible choices, and explain the cost of the alternative. Include query flexibility, transaction scope, partitioning, consistency settings, and operational ownership.
For an order ledger with interconnected integrity rules, PostgreSQL may be a sensible starting point. For content naturally retrieved as complete documents, MongoDB may fit well; for relationship traversal, evaluate a graph database against the actual queries.
Expect the interviewer to change a requirement, such as adding cross-record transactions or ad hoc reporting. Explain how that changes your choice.
Modern database work also crosses language boundaries: the DZone database-systems survey reports that 72% of respondents use at least two data query or interaction languages. Be ready to inspect ORM-generated SQL rather than treating application code as separate from database behavior.
10. Views, Stored Procedures, Triggers, and Functions
A reporting team needs employee department information but mustn't read salaries. A view can expose the approved projection, provided permissions prevent users from bypassing it through base-table access.
A regular view stores a query definition, not a separately maintained result set. A materialized view stores results, introducing refresh and freshness decisions.
Explain Where Logic Belongs
- Stored procedures: Encapsulate callable database operations, with transaction and result behavior depending on the engine.
- Functions: Return scalar or tabular values and may be usable within queries, subject to engine-specific restrictions.
- Triggers: Run automatically for defined events and can enforce auditing or other database-side behavior.
A weak answer claims stored procedures automatically prevent SQL injection or that views always improve performance. Unsafe dynamic SQL can exist inside procedures, and a regular view doesn't cache results by default.
Expect probes about execution privileges, trigger recursion, deployment order, and hidden side effects. A salary-audit trigger can capture changes from multiple applications, but a failing audit write may also fail the original update.
Your 60-second structure: Define the objects through a reporting-and-auditing example, explain permissions, then identify the maintenance cost. Contrast a regular view with a materialized view before recommending either.
Database-side logic works well when enforcement must apply across writers. Avoid burying complex external workflows in triggers, where developers may miss the behavior and struggle to test, observe, or roll it back safely.
The 10 DBMS Interview Questions at a Glance
| Topic | Core Concept Tested | Common Follow-up Probe | Difficulty |
|---|---|---|---|
| ACID Properties | Transaction guarantees: atomicity, consistency, isolation, and durability | Explain a bank transfer and how each property is implemented | Foundational |
| Database Normalization (1NF to BCNF) | Normal forms, functional dependencies, and reducing data anomalies | Distinguish 3NF from BCNF or explain when denormalization is useful | Intermediate |
| Keys in DBMS (Primary, Candidate, Foreign, Super, Surrogate) | Key types, uniqueness, and referential integrity | Compare candidate, primary, and surrogate keys; explain composite keys | Foundational |
| Indexing: B-Trees, B+ Trees, and Hash Indexes | Index structures, query performance, and write/storage trade-offs | Explain B+ tree range scans or the leftmost-prefix rule for composite indexes | Intermediate |
| SQL Joins (Inner, Outer, Cross, Self) | Combining related rows across tables with different join types | Explain why a LEFT JOIN can behave like an INNER JOIN after filtering | Foundational |
| Transaction Isolation Levels and Concurrency Problems | Isolation levels and dirty, non-repeatable, and phantom reads | Identify which anomalies each isolation level prevents | Intermediate |
| Deadlocks and Concurrency Control | Lock conflicts, deadlock detection, prevention, and resolution | Draw a wait-for graph or explain how consistent lock ordering prevents deadlocks | Advanced |
| Database Recovery and Write-Ahead Logging | WAL, crash recovery, checkpoints, and ARIES phases | Explain why log records must be persisted before data pages | Advanced |
| DBMS vs. RDBMS and SQL vs. NoSQL | Data models and trade-offs in schema, consistency, scaling, and queries | Choose a database type for a workload and justify the trade-offs | Foundational |
| Views, Stored Procedures, Triggers, and Functions | Database objects for presenting data and encapsulating logic | Compare views with materialized views, or explain when triggers are appropriate | Intermediate |
Turn These Answers Into Interview-Ready Reflexes
Reading DBMS interview questions isn't the same as preparing to answer them. You need to retrieve the concept, explain the mechanism, and respond when someone challenges your assumptions. Silent recognition won't tell you whether you can do that under pressure.
Rehearse each answer aloud with a timer. Use the same underlying sequence: state the guarantee, demonstrate the mechanism, identify the failure mode, and explain the trade-off. Keep the opening focused enough that the interviewer can choose where to probe.
Then practice interruption. After explaining atomicity, switch immediately to a crash scenario; after explaining an index, defend why the optimizer might ignore it. If you lose the thread, record the missing connection rather than memorizing a longer paragraph.
Practice With Evidence, Not Just Definitions
Build a small database containing customers, orders, accounts, and inventory. Use it to reproduce the behaviors you describe.
- Test query correctness: Include unmatched rows, duplicate relationships, and
NULLvalues. - Test concurrency: Run overlapping transactions in separate sessions and inspect blocking or failures.
- Test performance reasoning: Compare plans before and after an index, including effects on writes.
- Test recovery understanding: Explain which failures require restart recovery, backups, or a broader disaster-recovery procedure.
Scenario practice matters because operational judgment extends beyond vocabulary. The DataCamp DBMS interview guide includes performance and troubleshooting topics alongside foundational concepts; strengthen your preparation by requiring yourself to name the evidence you'd collect before proposing a fix.
Calibrate your depth to the role. Junior candidates should prioritize correct queries, constraints, and clear explanations. Senior candidates should also discuss safe rollout, rollback, observability, cost, and how they'd communicate the risk of a database change.
Our Interview Pilot AI mock interviews include answer evaluation, so you can pressure-test spoken responses and drill weak spots using the full paid question bank of approximately 10,000 questions. Our Interview Copilot provides real-time, context-aware answers during live technical interviews, adapted to your resume and target role; download the app for macOS, Windows, iOS, or Android to practice before the actual interview, and use live assistance only where the interviewer's rules permit it.
Finish each practice session by answering the question you handled least convincingly again without notes. Don't aim for a polished recital. Aim for an explanation that remains correct when the workload, failure, or business requirement changes.
Our guided mock interviews, answer evaluation, and searchable question bank can help you rehearse DBMS concepts and identify where your reasoning breaks down. Visit Interview Pilot to download the app for your device and practice explaining transactions, joins, indexing, and recovery aloud before your next technical interview.
Topics
dbms interview questions
database interview prep
SQL joins
ACID properties
indexing
Continue reading

Interviews
Insurance Questions for Interview: 10 Answers That Land
The 10 most common insurance questions for interview panels across underwriting, claims, sales and actuarial roles — with answer guidance for each.
November 8, 2026
19 min read

Interviews
Interview Business Casual: What to Wear and When
Interview business casual explained: industry-by-industry outfits, piece-by-piece checklists and video-call tips so you dress one step smarter.
November 8, 2026
14 min read

Interviews
Post-Interview Follow-Up: When to Send It and What to Say
Send a thank-you within 24 hours, then check in after the date they gave you. Get the timing, the wording and ready-to-edit email templates.
November 8, 2026