50 DBMS Interview Questions and Answers (2026): Normalization to Transactions

DBMS interview questions 2026: normalization, ACID and indexing

Last updated: October 2026

DBMS is one of the "core four" subjects, along with OOPs, operating systems and computer networks, that campus interviewers love. TCS, Infosys, Wipro, Accenture and almost every product company's fresher round includes a few DBMS questions, usually right after you finish a coding problem.

The questions are mostly predictable: keys, normalization, ACID, transactions, indexing and joins. What separates a good answer from an average one is a quick example. "2NF removes partial dependency" is fine. "2NF removes partial dependency, like storing the course name in an enrolment table keyed by student and course" is what gets you through.

This guide gives you 50 questions with short answers and examples. For the hands-on query side, pair it with our SQL interview questions.

DBMS interview questions: the quick answer

  • What gets tested: DBMS vs RDBMS, keys, ER diagrams, normalization (1NF, 2NF, 3NF, BCNF), ACID, transactions and schedules, locking and deadlocks, indexing and B+ trees, joins, and SQL vs NoSQL.
  • Typical format: 4–8 theory questions inside a technical round, often with one SQL query to write.
  • Most asked topics: normalization with an example, ACID with a bank example, primary vs candidate vs foreign keys, and what an index is.
  • Tip: draw small tables when explaining. Interviewers remember candidates who make it visual.

Basics (1–12)

1. What is a DBMS?

A Database Management System is software that stores, organises and retrieves data, and controls who can access it. It handles concurrency, recovery and integrity so applications don't have to. Examples: MySQL, PostgreSQL, Oracle, SQL Server and MongoDB.

2. What are the advantages of a DBMS over a file system?

Less data redundancy and inconsistency, easy querying with SQL, concurrent access without corrupting data, backup and recovery, security and access control, and integrity constraints. With plain files, every program has to handle all of this itself.

3. What is the difference between DBMS and RDBMS?

An RDBMS is a DBMS that stores data in related tables (rows and columns) and enforces relationships with keys. It follows relational model rules and uses SQL. Every RDBMS is a DBMS, but not every DBMS is relational. MongoDB, for example, is a document database.

4. What are the three levels of data abstraction?

  • Physical level: how data is actually stored on disk (files, blocks, indexes).
  • Logical (conceptual) level: what data is stored and how it relates (tables, columns, relationships).
  • View level: what each user or application sees, such as only some columns.

5. What is data independence?

The ability to change one level without affecting the level above. Physical data independence: change storage or indexes without changing the logical schema. Logical data independence: change the logical schema, such as adding a column, without breaking user views. Logical independence is harder to achieve.

6. What is a schema vs an instance?

The schema is the structure: tables, columns, types and constraints. It changes rarely. An instance is the actual data in the database at a given moment, which changes all the time.

7. What is an ER model?

An Entity-Relationship model is a diagram of the data before you build tables. Entities are things (Student, Course), attributes are their properties (name, credits), and relationships connect them (Student enrols in Course).

8. What are the types of attributes in an ER model?

Simple vs composite (name split into first and last), single-valued vs multivalued (phone numbers), stored vs derived (age derived from date of birth), and key attributes (roll number).

9. What is cardinality in an ER model?

How many instances of one entity relate to another: one-to-one (person–passport), one-to-many (department–employees) and many-to-many (students–courses). Many-to-many relationships become a separate junction table when you build the database.

10. What is a weak entity?

An entity that can't be identified by its own attributes alone and depends on a strong (owner) entity. For example, a Dependent of an Employee is identified by the employee ID plus the dependent's name.

11. What is generalisation vs specialisation?

Generalisation combines similar entities into a higher-level one (Car and Bike become Vehicle). Specialisation splits an entity into sub-types (Employee into Engineer and Manager). Aggregation treats a relationship as an entity so it can take part in another relationship.

12. What are relational algebra operations?

The mathematical basis of SQL: selection (σ, filter rows), projection (π, choose columns), union, set difference, Cartesian product, rename, and joins built from these. A query like SELECT name FROM student WHERE cgpa > 8 is π-name of σ-cgpa>8 (student).

Keys and constraints (13–19)

13. What is a super key?

Any set of columns that uniquely identifies a row. In a Student table, {roll_no}, {roll_no, name} and {email} are all super keys.

14. What is a candidate key?

A minimal super key, with no extra columns. If both roll_no and email uniquely identify a student, both are candidate keys.

15. What is a primary key?

The candidate key you choose as the main identifier. It must be unique and not NULL. The candidate keys you don't choose are called alternate keys.

16. What is a foreign key?

A column that references the primary key of another table, enforcing referential integrity. An enrolment's student_id must exist in the Student table.

17. What is a composite key?

A primary key made of two or more columns, such as (student_id, course_id) in an Enrolment table, where neither column alone is unique.

18. What is the difference between a primary key and a unique key?

A primary key can't be NULL, and a table has only one. A unique key allows NULL values and a table can have several. Both prevent duplicate values.

19. What are integrity constraints?

Rules that keep data valid: domain constraints (correct type and range), entity integrity (the primary key isn't NULL), referential integrity (foreign keys point to existing rows) and key constraints (uniqueness).

Normalization (20–28)

20. What is normalization, and why is it needed?

Organising tables to reduce redundancy and avoid anomalies. Without it, the same fact is stored in many places, so updates miss copies, inserts need unrelated data, and deletes lose information.

21. What are insertion, update and deletion anomalies?

Take one table Student(roll, name, course, faculty_name):

  • Insertion anomaly: you can't add a new course until a student enrols in it.
  • Update anomaly: if a faculty member changes, you have to update every row of that course.
  • Deletion anomaly: deleting the last student in a course loses the course's faculty information.

22. What is a functional dependency?

A → B means the value of A determines the value of B. For example, roll_no → name. Normalization is about organising tables so dependencies point only to keys.

23. What is 1NF?

First Normal Form: each cell holds a single (atomic) value, and there are no repeating groups. A "phones" column holding "98xxx, 99xxx" violates 1NF; move phone numbers to their own table or rows.

24. What is 2NF?

The table is in 1NF and has no partial dependency: no non-key column depends on only part of a composite key. In Enrolment(student_id, course_id, course_name, grade), course_name depends only on course_id, so move it to a Course table.

25. What is 3NF?

The table is in 2NF and has no transitive dependency: non-key columns depend only on the key, not on other non-key columns. In Employee(emp_id, dept_id, dept_name), dept_name depends on dept_id, not directly on emp_id, so move it to a Department table.

26. What is BCNF?

Boyce-Codd Normal Form is a stricter 3NF: for every functional dependency X → Y, X must be a super key. It handles edge cases where 3NF still allows anomalies, usually when there are overlapping candidate keys.

27. What are 4NF and 5NF?

4NF removes multivalued dependencies: if a teacher has independent sets of subjects and hobbies, store them in two tables, not one. 5NF removes join dependencies. These are rarely asked beyond a definition.

28. What is denormalization, and when is it used?

Deliberately adding redundancy to speed up reads, for example storing the customer name in the orders table for a reporting dashboard. It's common in data warehouses and read-heavy systems, at the cost of extra storage and keeping copies in sync.

Transactions and concurrency (29–39)

29. What is a transaction?

A sequence of operations treated as one unit of work. Transferring ₹1,000 means debiting account A and crediting account B; both must succeed, or neither should.

30. What are the ACID properties?

  • Atomicity: all or nothing. If the credit fails, the debit is rolled back.
  • Consistency: the database moves from one valid state to another (total money stays the same).
  • Isolation: concurrent transactions don't see each other's partial changes.
  • Durability: once committed, changes survive crashes, thanks to logs.

31. What are the states of a transaction?

Active → partially committed → committed. Or active → failed → aborted (rolled back), after which it can be restarted or killed.

32. What is a schedule? Serial vs concurrent?

A schedule is the order in which operations from multiple transactions run. A serial schedule runs transactions one after another, which is safe but slow. A concurrent schedule interleaves them for speed, and must be checked for correctness.

33. What is serializability?

A concurrent schedule is serializable if its result is the same as some serial schedule. Conflict serializability is checked with a precedence graph: if the graph has no cycle, the schedule is conflict serializable.

34. What problems can concurrency cause?

  • Dirty read: reading data another transaction hasn't committed yet.
  • Lost update: two transactions overwrite each other's changes.
  • Non-repeatable read: reading the same row twice gives different values.
  • Phantom read: re-running a query returns new rows that another transaction inserted.

35. What are isolation levels?

LevelDirty readNon-repeatable readPhantom read
Read uncommittedPossiblePossiblePossible
Read committedPreventedPossiblePossible
Repeatable readPreventedPreventedPossible (per the SQL standard)
SerializablePreventedPreventedPrevented

36. What is locking? Shared vs exclusive locks?

A shared (S) lock lets many transactions read an item at the same time. An exclusive (X) lock is needed to write, and blocks all other locks on that item.

37. What is two-phase locking (2PL)?

A protocol in which each transaction first acquires all the locks it needs (growing phase) and then releases them (shrinking phase), never acquiring a new lock after releasing one. It guarantees conflict serializability. Strict 2PL holds exclusive locks until commit, which prevents cascading rollbacks.

38. What is a deadlock, and how is it handled?

Two or more transactions wait for each other's locks forever. DBMSs handle this through prevention (wait-die or wound-wait schemes based on timestamps), avoidance, or detection and recovery: build a wait-for graph, find the cycle, and roll back one transaction (the victim).

39. How does a DBMS recover from a crash?

With a log of every change (write-ahead logging: the log is written before the data). After a crash, it redoes committed transactions whose changes hadn't reached disk and undoes uncommitted ones. Checkpoints limit how far back recovery has to read.

Indexing, storage and joins (40–46)

40. What is an index?

A data structure that speeds up searches on a column, like the index at the back of a book. Without one, the DBMS scans every row. Indexes make writes slightly slower and use extra space.

41. What is the difference between clustered and non-clustered indexes?

A clustered index sorts and stores the table rows themselves in index order, so there's only one per table. A non-clustered index is a separate structure with pointers to the rows, and you can have many.

42. Why do databases use B+ trees for indexes?

B+ trees stay balanced, have high fan-out (so few disk reads even for millions of rows), keep all data pointers in leaf nodes, and link leaves together, which makes range queries like BETWEEN fast. A B-tree stores data in internal nodes too, which makes range scans less efficient.

43. What is hashing in DBMS?

Using a hash function on a key to find the bucket where a record lives. It's very fast for exact matches (WHERE id = 42) but useless for range queries. Collisions are handled with chaining or open addressing.

44. What are the types of joins?

Inner join (matching rows only), left/right outer join (all rows from one side plus matches), full outer join (all rows from both), cross join (every combination), self join (a table with itself) and natural join (matching on columns with the same name).

45. What is a view, and what is a materialized view?

A view is a stored query that acts like a virtual table; it runs every time you use it. A materialized view stores the result physically and is refreshed periodically, so it's faster to read but can be slightly out of date.

46. What are triggers and stored procedures?

A trigger runs automatically on an INSERT, UPDATE or DELETE, for example to log changes to salaries. A stored procedure is saved SQL logic you call explicitly, used to bundle business operations and reduce network round trips.

NoSQL and modern databases (47–50)

47. What is NoSQL, and what are its types?

Non-relational databases designed for flexible schemas and horizontal scale:

  • Document: MongoDB, Couchbase
  • Key-value: Redis, DynamoDB
  • Wide-column: Cassandra, HBase
  • Graph: Neo4j

Our MongoDB interview questions cover the document model in depth.

48. SQL vs NoSQL: when would you use each?

Use SQL when data is structured and related, you need joins, and strong consistency matters, as with banking, orders and HR systems. Use NoSQL for flexible or fast-changing schemas, huge scale, high write throughput or specific access patterns, such as catalogues, sessions, IoT data and feeds. Many systems use both.

49. What is the CAP theorem?

In a distributed database, when a network partition happens, you must choose between consistency (every read sees the latest write) and availability (every request gets a response). Partition tolerance isn't optional in real networks. So systems lean CP (such as HBase) or AP (such as Cassandra, with tunable consistency).

50. What is sharding vs replication?

Sharding splits data across machines by a key (users A–M on one server, N–Z on another) to scale writes and storage. Replication copies the same data to multiple machines for availability and read scaling. Large systems use both.

Common mistakes candidates make

  • Defining normal forms without an example table.
  • Mixing up candidate keys and super keys.
  • Saying "ACID" without explaining each letter with a real case.
  • Confusing a B-tree with a binary tree.
  • Saying NoSQL means "no SQL at all". Many NoSQL databases have query languages, and some support SQL.

A 5-day DBMS revision plan

DayTopics
1DBMS basics, abstraction levels, ER model, keys
2Functional dependencies, 1NF to BCNF with your own examples
3Transactions, ACID, schedules, serializability, isolation levels
4Locking, 2PL, deadlocks, recovery, indexing, B+ trees
5Joins and SQL practice, NoSQL, CAP, sharding; 20 MCQs

Where DBMS gets asked

DBMS is standard in campus placements and fresher interviews at IT services companies. See how it fits into each process in our TCS and Infosys interview guides. Developers, data analysts and QA engineers also get DBMS questions in technical rounds.

Related core-subject prep: OOPs interview questions, SQL interview questions, advanced SQL interview questions and DSA interview questions.

Frequently asked questions

What are the most important DBMS topics for interviews?

Normalization (with examples), ACID properties, keys, transactions and concurrency, indexing, and joins. These six cover most questions in fresher interviews.

Is DBMS asked in product company interviews?

Yes, usually 2–4 quick questions in a technical round, often leading into a SQL query or a schema design question, such as "design tables for a library system".

Which is better for practice: MySQL or PostgreSQL?

Either works. Install one, create a few tables, and practise normalization and transactions hands-on. Running BEGIN, ROLLBACK and COMMIT yourself makes ACID questions much easier to answer.

What is the difference between DBMS and SQL?

A DBMS is the software that manages the database. SQL is the language you use to talk to a relational DBMS.

How should I explain normalization in an interview?

Start with a messy table, point out one anomaly, then split it step by step into 1NF, 2NF and 3NF, naming the dependency you removed at each step. Two minutes, one example, done.


Getting ready for placements or your first developer role? Explore fresher and developer jobs on Weekday, and check your resume with our free ATS resume checker.

Latest Articles

Browse Articles
Use AI to find jobs and apply

Stop manually filling job applications. Use AI to auto-apply to jobs

Browse jobs now