DSA Tracker

DSA Tracker

DBMS interview practice

The 40 database questions, ranked by how many of the surveyed prep sources list each one.

Database Management Systems Interview Questions (All 40 Reference)

Printable cheat sheet →
#1 (dbms-001)•medium•Asked in 10 surveyed sources

What is normalization in a DBMS, and why is it used?

Interview one-liner: Normalization restructures tables to remove redundancy and the update problems that redundancy causes.

#2 (dbms-002)•medium•Asked in 10 surveyed sources

A table is in 1NF, and one non-key column depends on only part of its composite primary key. Which normal form does the table fail first?

Interview one-liner: The table fails Second Normal Form, because a non-key column depends on only part of a composite key.

#3 (dbms-003)•easy•Asked in 9 surveyed sources

What are the ACID properties of a transaction?

Interview one-liner: ACID stands for atomicity, consistency, isolation and durability, the four guarantees that make transactions reliable.

#4 (dbms-004)•easy•Asked in 9 surveyed sources

What are the advantages of using a DBMS over a traditional file system?

Interview one-liner: A DBMS replaces scattered program-specific files with one controlled store that handles integrity, sharing and security.

#5 (dbms-005)•easy•Asked in 9 surveyed sources

Which type of SQL join returns only the row pairs whose join condition matches in both tables?

Interview one-liner: An inner join returns only the row pairs that match on the join condition in both tables.

#6 (dbms-006)•medium•Asked in 9 surveyed sources

What is the main cost of adding an index to a table?

Interview one-liner: An index speeds up lookups, but it costs storage and slows writes, since inserts and deletes must update every index.

#7 (dbms-007)•medium•Asked in 9 surveyed sources

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

Interview one-liner: DELETE removes chosen rows, TRUNCATE empties the table in one fast step, and DROP removes the table itself.

#8 (dbms-008)•easy•Asked in 8 surveyed sources

What is a DBMS?

Interview one-liner: A DBMS is software that defines, stores, retrieves and controls access to a database, so applications do not manage files themselves.

#9 (dbms-009)•easy•Asked in 8 surveyed sources

What are the main advantages a DBMS provides beyond simply storing data?

Interview one-liner: A DBMS gives data independence, central integrity rules, crash recovery and per-user security, which applications would otherwise rebuild badly.

#10 (dbms-010)•easy•Asked in 8 surveyed sources

Which SQL sublanguage contains the GRANT and REVOKE commands?

Interview one-liner: GRANT and REVOKE belong to DCL, the data control language.

#11 (dbms-011)•medium•Asked in 8 surveyed sources

Why would a designer deliberately denormalize a table that is already in a good normal form?

Interview one-liner: Denormalization deliberately adds duplicated data to speed up frequent reads, and the application must keep the copies in sync.

#12 (dbms-012)•easy•Asked in 8 surveyed sources

What are the different types of keys in a database?

Interview one-liner: Superkeys and candidate keys identify rows, the primary key is the chosen one, and foreign keys link tables together.

#13 (dbms-013)•easy•Asked in 8 surveyed sources

Which statement about a primary key is always true?

Interview one-liner: A primary key uniquely identifies each row and can never be NULL.

#14 (dbms-014)•easy•Asked in 8 surveyed sources

Table Enrolment has a nullable foreign key column student_id referencing Student(student_id). Which insert into Enrolment satisfies referential integrity?

Interview one-liner: A foreign key requires every non-null value to match an existing key in the referenced table, permitting NULL unless NOT NULL is specified.

#15 (dbms-015)•medium•Asked in 8 surveyed sources

Which statement correctly contrasts a primary key with a unique key in the same table?

Interview one-liner: A table has exactly one primary key but may have many unique keys.

#16 (dbms-016)•easy•Asked in 8 surveyed sources

Which shape represents an entity in a standard entity-relationship diagram?

Interview one-liner: Entities are drawn as rectangles, attributes as ovals and relationships as diamonds.

#17 (dbms-017)•medium•Asked in 8 surveyed sources

Which statement about a clustered index is correct?

Interview one-liner: A clustered index sets the physical order of the table's rows, so a table can have only one.

#18 (dbms-018)•medium•Asked in 8 surveyed sources

Which lock lets several transactions read the same item at once, but blocks any transaction that wants to write it?

Interview one-liner: A shared lock lets many transactions read an item together, while an exclusive lock admits only one holder.

#19 (dbms-019)•easy•Asked in 8 surveyed sources

What is a view in a relational database?

Interview one-liner: A view is a named query that presents its result as a virtual table, usually without storing data of its own.

#20 (dbms-020)•easy•Asked in 7 surveyed sources

What distinguishes an RDBMS from a general DBMS?

Interview one-liner: An RDBMS is a DBMS built on the relational model, where data lives in tables linked by keys.

#21 (dbms-021)•medium•Asked in 7 surveyed sources

In the three-level architecture, which level describes what data is stored and how the tables relate, without storage details?

Interview one-liner: The logical level describes the tables, their columns and their relationships, hiding how the data is stored.

#22 (dbms-022)•medium•Asked in 7 surveyed sources

Which description fits a candidate key?

Interview one-liner: A candidate key is a minimal superkey: remove any attribute from it and it stops identifying rows uniquely.

#23 (dbms-023)•easy•Asked in 6 surveyed sources

Students enrol in many courses, and each course has many students. What type of relationship is this?

Interview one-liner: Students and courses form a many-to-many relationship, implemented with a junction table.

#24 (dbms-024)•medium•Asked in 6 surveyed sources

What are the terms entity, entity type and entity set in a DBMS?

Interview one-liner: An entity is one object, an entity type is its category with attributes, and an entity set is the current collection of that type.

#25 (dbms-025)•easy•Asked in 6 surveyed sources

What is a transaction in a DBMS?

Interview one-liner: A transaction is a group of reads and writes that the DBMS treats as one all-or-nothing unit of work.

#26 (dbms-026)•hard•Asked in 6 surveyed sources

How does a DBMS handle concurrency control?

Interview one-liner: Concurrency control uses locks, timestamps or versions so that simultaneous transactions cannot corrupt each other's results.

#27 (dbms-027)•medium•Asked in 6 surveyed sources

Which kind of subquery is re-evaluated for each row of the outer query?

Interview one-liner: A correlated subquery refers to the outer query's current row, so it depends on that row.

#28 (dbms-028)•easy•Asked in 6 surveyed sources

Which set operator removes duplicate rows from its combined result, and what does that cost?

Interview one-liner: UNION removes duplicate rows at the cost of a sort or hash, while UNION ALL keeps every row and skips that work.

#29 (dbms-029)•easy•Asked in 6 surveyed sources

What is a stored procedure in a DBMS?

Interview one-liner: A stored procedure is a named block of SQL logic kept in the database and called by applications.

#30 (dbms-030)•medium•Asked in 6 surveyed sources

What is a trigger in a DBMS, and when would you use one?

Interview one-liner: A trigger is stored code that the DBMS runs automatically when a table changes, used for audit trails and rules every writer must obey.

#31 (dbms-031)•easy•Asked in 5 surveyed sources

What is a database cursor, and how is it used?

Interview one-liner: A cursor is a handle that lets procedural code walk through a query's rows one at a time.

#32 (dbms-032)•medium•Asked in 5 surveyed sources

What is the difference between a trigger and a stored procedure?

Interview one-liner: A procedure runs when something calls it, while a trigger runs by itself when a table event occurs.

#33 (dbms-033)•easy•Asked in 5 surveyed sources

Which description best defines a database?

Interview one-liner: A database is a structured collection of related data, stored so many users and programs can use it.

#34 (dbms-034)•easy•Asked in 5 surveyed sources

Which statement describes the schema of a relation?

Interview one-liner: A schema is the stable description of a relation: its name, attributes, domains and constraints.

#35 (dbms-035)•easy•Asked in 5 surveyed sources

Which constraint makes a column refuse an empty value?

Interview one-liner: NOT NULL is the constraint that refuses an empty value in a column.

#36 (dbms-036)•medium•Asked in 5 surveyed sources

Under referential integrity, what must hold for each non-NULL foreign key value?

Interview one-liner: Every non-NULL foreign key value must match an existing value of the referenced key in the parent table.

#37 (dbms-037)•medium•Asked in 5 surveyed sources

After detecting a deadlock, what does a DBMS usually do?

Interview one-liner: On detecting a deadlock, the DBMS picks a victim, rolls it back and releases its locks so the rest can proceed.

#38 (dbms-038)•medium•Asked in 4 surveyed sources

What is a functional dependency?

Interview one-liner: A functional dependency X -> Y means that any two rows agreeing on X must also agree on Y.

#39 (dbms-039)•hard•Asked in 4 surveyed sources

In a database, which term means the set of tuples stored at one particular moment?

Interview one-liner: The extension of a relation is the set of tuples stored at a given moment, while the intension is its schema.

#40 (dbms-040)•hard•Asked in 4 surveyed sources

What is a checkpoint in a DBMS, and when does it occur?

Interview one-liner: A checkpoint is a safe point where the DBMS flushes its log and modified pages, so redo after a crash need not start at the log's beginning.

More interview rounds