Skip to content

DBMS Interview Questions for Freshers: The Ones Actually Asked

The DBMS interview questions asked most in campus and entry-level interviews: basics, normalization, SQL queries, ACID transactions and indexing, with model answers.

5 min read
Illustration of a desk with a database cylinder, a laptop and a question-mark bookend, representing DBMS interview questions

DBMS interview questions for freshers cluster around five areas: basic concepts (what a DBMS is, keys, schemas), normalization, SQL queries, transactions and ACID properties, and indexing. This guide covers the DBMS interview questions asked most often in campus and entry-level interviews, with short model answers you can adapt to your own words.

Basic DBMS questions asked in almost every interview

What is a DBMS and how is it different from a file system? A database management system stores data with structure, concurrency control, security and query support. A file system stores raw files with no relationships between them, no transaction safety, and no query language.

What is the difference between a primary key and a foreign key? A primary key uniquely identifies each row in a table and cannot be null. A foreign key is a column that references the primary key of another table, creating a relationship between them.

What is a candidate key vs a super key? A super key is any set of columns that uniquely identifies a row. A candidate key is a minimal super key - remove any column and it stops being unique. The primary key is the candidate key the designer chooses.

What are the types of relationships in an ER model? One-to-one, one-to-many, and many-to-many. Many-to-many relationships are implemented through a junction table with two foreign keys.

What is the difference between DELETE, TRUNCATE and DROP? DELETE removes selected rows and can be rolled back. TRUNCATE removes all rows quickly and usually cannot be rolled back. DROP removes the entire table structure. Saying this in one clean line is a classic fresher filter.

Normalization questions

What is normalization and why do we do it? Normalization organizes tables to remove redundancy and avoid update, insert and delete anomalies. You split large tables into smaller ones linked by keys.

  • 1NF: every column holds atomic values, no repeating groups.
  • 2NF: 1NF plus no partial dependency - every non-key column depends on the whole primary key (matters for composite keys).
  • 3NF: 2NF plus no transitive dependency - non-key columns do not depend on other non-key columns.

When would you denormalize? When read performance matters more than storage cleanliness - reporting tables, analytics, caching. Interviewers ask this to check you know normalization is a trade-off, not a religion.

SQL questions freshers must answer cold

Find the second highest salary. The expected answer uses a subquery: SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees); Bonus points for mentioning LIMIT/OFFSET or window function alternatives.

What is the difference between WHERE and HAVING? WHERE filters rows before grouping; HAVING filters groups after GROUP BY. "WHERE is for rows, HAVING is for groups" is the line interviewers want.

Explain JOIN types. INNER JOIN returns matching rows in both tables. LEFT JOIN returns all left-table rows plus matches (NULLs where no match). RIGHT JOIN mirrors it. FULL OUTER JOIN returns everything from both sides.

What is a correlated subquery? A subquery that references columns from the outer query, so it runs once per outer row. Slower than a JOIN in many cases, which is a good follow-up point.

Transactions, ACID and concurrency

What is a transaction? A sequence of operations treated as one unit of work: either all of it commits, or none of it does.

Explain ACID. Atomicity (all or nothing), Consistency (the database moves from one valid state to another), Isolation (concurrent transactions do not interfere), Durability (committed data survives crashes).

What problems does isolation prevent? Dirty reads, non-repeatable reads and phantom reads. Mentioning at least one isolation level (READ COMMITTED or SERIALIZABLE) separates prepared candidates from memorized answers.

What is a deadlock? Two transactions each holding a lock the other needs. Databases detect deadlocks and kill one transaction. Prevention: consistent lock ordering and short transactions.

Indexing and performance

What is an index and why does it speed up queries? An index is a data structure (usually a B-tree) that lets the database find rows without scanning the whole table, like a book index versus reading every page.

What is the downside of indexes? They take storage and slow down INSERT, UPDATE and DELETE, because every write must also update the index. This is why you index columns you search on, not every column.

Clustered vs non-clustered index? A clustered index determines the physical order of rows (one per table, usually the primary key). Non-clustered indexes store a separate structure pointing to the rows, and a table can have many.

How to answer in the interview

  • Define the concept in one sentence, then give a concrete example. Interviewers reward structure.
  • For SQL questions, ask about table structure before writing the query - it shows real working habit.
  • If you do not know, say what you would check rather than bluffing. Freshers are not expected to know replication internals.
  • Revise with your own mini-project database. Explaining decisions you actually made beats any memorized answer.

Pair your DBMS prep with these OOPS interview questions - panels usually mix both in fresher technical rounds.

DBMS and OS questions usually come in the same technical round, so also prepare these operating system interview questions.

After DBMS, most panels move to operating systems and networks. These computer networks interview questions cover the networking side.

Frequently asked questions

Are DBMS questions asked in non-CS interviews?

Yes. IT services companies ask basic DBMS and SQL questions to any fresher in a technical role, including non-CS branches, because project training assumes it.

How deep should freshers go into DBMS?

Solid on basics, normalization up to 3NF, core SQL (joins, group by, subqueries), ACID and indexing. Advanced topics like partitioning and replication are a plus, not a requirement.

Is SQL or theory asked more in fresher interviews?

Both. Expect one or two live SQL queries plus conceptual questions. Practice writing queries by hand, since many interviews happen on paper or a shared doc.

Which DBMS should I learn for interviews?

MySQL or PostgreSQL. The concepts transfer across databases, and both are free to practice with.

Sources

Found this useful? Send it on.

WhatsAppLinkedIn

Keep reading