TomoLink
Core CS Subject

DBMS Interview Questions 2025

Complete DBMS & SQL interview Q&A for TCS, Infosys, Wipro & top company placements — with concise answers and example queries.

Top DBMS Interview Questions & Answers

Q1

What is a database? Difference between DBMS and RDBMS?

A database is an organized collection of data. DBMS manages data without enforcing relationships; RDBMS (e.g., MySQL, PostgreSQL) enforces relational integrity via foreign keys and tables.

Q2

What are ACID properties?

Atomicity (all or nothing), Consistency (data remains valid), Isolation (concurrent transactions don't interfere), Durability (committed transactions survive crashes).

Q3

Explain the different types of SQL commands.

DDL (CREATE, ALTER, DROP), DML (INSERT, UPDATE, DELETE), DQL (SELECT), DCL (GRANT, REVOKE), TCL (COMMIT, ROLLBACK, SAVEPOINT).

Q4

What is normalization? Explain 1NF, 2NF, 3NF.

1NF: Atomic values, no repeating groups. 2NF: No partial dependency on composite key. 3NF: No transitive dependency (non-key attribute depends only on primary key).

Q5

What is denormalization and when should you use it?

Denormalization intentionally introduces redundancy to speed up read queries. Used in read-heavy systems like reporting dashboards and data warehouses.

Q6

What is an index? Explain clustered vs non-clustered.

Index speeds up query lookups. Clustered: physically reorders table rows by index key (one per table). Non-clustered: separate structure pointing to rows (many per table).

Q7

What are the different types of JOINs in SQL?

INNER JOIN: matching rows in both tables. LEFT JOIN: all from left + matches. RIGHT JOIN: all from right + matches. FULL OUTER JOIN: all from both. CROSS JOIN: Cartesian product.

Q8

What is a transaction? Explain isolation levels.

A transaction is a unit of work. Isolation levels: Read Uncommitted, Read Committed, Repeatable Read, Serializable — controlling visibility of uncommitted changes.

Q9

What is a primary key vs foreign key?

Primary key uniquely identifies a row in a table. Foreign key in one table references the primary key of another, enforcing referential integrity.

Q10

What is a view in a database?

A view is a virtual table based on a SELECT query. Used for security (hiding columns), simplifying complex queries, and presenting data without duplication.

Q11

What is the difference between DELETE, TRUNCATE, and DROP?

DELETE: removes specific rows (can rollback). TRUNCATE: removes all rows quickly (cannot rollback). DROP: deletes the entire table structure and data.

Q12

What is NoSQL? When to use NoSQL over SQL?

NoSQL databases (MongoDB, Cassandra, Redis) store unstructured/semi-structured data. Use when: schema is flexible, horizontal scaling is needed, or data is document/key-value/graph.

Must-Know SQL Queries

Interviewers often ask you to write or trace these SQL patterns.

#1SELECT * FROM employees WHERE salary > 50000 ORDER BY salary DESC;
#2SELECT dept, COUNT(*) as count FROM employees GROUP BY dept HAVING COUNT(*) > 5;
#3SELECT e.name, d.dept_name FROM employees e INNER JOIN departments d ON e.dept_id = d.id;
#4SELECT name, salary, RANK() OVER (PARTITION BY dept ORDER BY salary DESC) as rank FROM employees;
#5SELECT * FROM employees WHERE id IN (SELECT manager_id FROM employees WHERE manager_id IS NOT NULL);

Quick Reference: Normalization

1NF

Each column contains atomic (indivisible) values. No repeating groups or arrays.

2NF

Must be in 1NF. No partial dependency — every non-key column depends on the whole primary key.

3NF

Must be in 2NF. No transitive dependency — non-key column doesn't depend on another non-key column.

BCNF

Stronger 3NF. For every functional dependency X→Y, X must be a superkey.

4NF

No multi-valued dependencies. A row shouldn't imply multiple independent multi-valued facts.

5NF

No join dependencies that are not implied by candidate keys.

Practice DBMS with company questions

TomoLink curates DBMS & SQL questions asked in TCS, Infosys, Wipro, and top IT company drives.

Start DBMS Prep

Related Guides