
Complete DBMS & SQL interview Q&A for TCS, Infosys, Wipro & top company placements — with concise answers and example queries.
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.
Atomicity (all or nothing), Consistency (data remains valid), Isolation (concurrent transactions don't interfere), Durability (committed transactions survive crashes).
DDL (CREATE, ALTER, DROP), DML (INSERT, UPDATE, DELETE), DQL (SELECT), DCL (GRANT, REVOKE), TCL (COMMIT, ROLLBACK, SAVEPOINT).
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).
Denormalization intentionally introduces redundancy to speed up read queries. Used in read-heavy systems like reporting dashboards and data warehouses.
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).
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.
A transaction is a unit of work. Isolation levels: Read Uncommitted, Read Committed, Repeatable Read, Serializable — controlling visibility of uncommitted changes.
Primary key uniquely identifies a row in a table. Foreign key in one table references the primary key of another, enforcing referential integrity.
A view is a virtual table based on a SELECT query. Used for security (hiding columns), simplifying complex queries, and presenting data without duplication.
DELETE: removes specific rows (can rollback). TRUNCATE: removes all rows quickly (cannot rollback). DROP: deletes the entire table structure and data.
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.
Interviewers often ask you to write or trace these SQL patterns.
Each column contains atomic (indivisible) values. No repeating groups or arrays.
Must be in 1NF. No partial dependency — every non-key column depends on the whole primary key.
Must be in 2NF. No transitive dependency — non-key column doesn't depend on another non-key column.
Stronger 3NF. For every functional dependency X→Y, X must be a superkey.
No multi-valued dependencies. A row shouldn't imply multiple independent multi-valued facts.
No join dependencies that are not implied by candidate keys.
TomoLink curates DBMS & SQL questions asked in TCS, Infosys, Wipro, and top IT company drives.
Start DBMS Prep