DSA Tracker

DSA Tracker

← Back to interactive practice

Print or save this cheat sheet to PDF for quick interview revision.

Database Management Systems: Top 40 Fresher Interview Questions

Ranked by how many of the surveyed prep sources list each question. Curated for fast active recall.

Q1 • dbms-001medium • 10 sources

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

Answer: Normalization restructures tables to remove redundancy and the update problems that redundancy causes.

Q2 • dbms-002medium • 10 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?

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

Q3 • dbms-003easy • 9 sources

What are the ACID properties of a transaction?

Answer: ACID stands for atomicity, consistency, isolation and durability, the four guarantees that make transactions reliable.

Q4 • dbms-004easy • 9 sources

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

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

Q5 • dbms-005easy • 9 sources

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

Answer: An inner join returns only the row pairs that match on the join condition in both tables.

Q6 • dbms-006medium • 9 sources

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

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

Q7 • dbms-007medium • 9 sources

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

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

Q8 • dbms-008easy • 8 sources

What is a DBMS?

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

Q9 • dbms-009easy • 8 sources

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

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

Q10 • dbms-010easy • 8 sources

Which SQL sublanguage contains the GRANT and REVOKE commands?

Answer: GRANT and REVOKE belong to DCL, the data control language.

Q11 • dbms-011medium • 8 sources

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

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

Q12 • dbms-012easy • 8 sources

What are the different types of keys in a database?

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

Q13 • dbms-013easy • 8 sources

Which statement about a primary key is always true?

Answer: A primary key uniquely identifies each row and can never be NULL.

Q14 • dbms-014easy • 8 sources

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

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

Q15 • dbms-015medium • 8 sources

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

Answer: A table has exactly one primary key but may have many unique keys.

Q16 • dbms-016easy • 8 sources

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

Answer: Entities are drawn as rectangles, attributes as ovals and relationships as diamonds.

Q17 • dbms-017medium • 8 sources

Which statement about a clustered index is correct?

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

Q18 • dbms-018medium • 8 sources

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

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

Q19 • dbms-019easy • 8 sources

What is a view in a relational database?

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

Q20 • dbms-020easy • 7 sources

What distinguishes an RDBMS from a general DBMS?

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

Q21 • dbms-021medium • 7 sources

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

Answer: The logical level describes the tables, their columns and their relationships, hiding how the data is stored.

Q22 • dbms-022medium • 7 sources

Which description fits a candidate key?

Answer: A candidate key is a minimal superkey: remove any attribute from it and it stops identifying rows uniquely.

Q23 • dbms-023easy • 6 sources

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

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

Q24 • dbms-024medium • 6 sources

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

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

Q25 • dbms-025easy • 6 sources

What is a transaction in a DBMS?

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

Q26 • dbms-026hard • 6 sources

How does a DBMS handle concurrency control?

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

Q27 • dbms-027medium • 6 sources

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

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

Q28 • dbms-028easy • 6 sources

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

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

Q29 • dbms-029easy • 6 sources

What is a stored procedure in a DBMS?

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

Q30 • dbms-030medium • 6 sources

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

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

Q31 • dbms-031easy • 5 sources

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

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

Q32 • dbms-032medium • 5 sources

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

Answer: A procedure runs when something calls it, while a trigger runs by itself when a table event occurs.

Q33 • dbms-033easy • 5 sources

Which description best defines a database?

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

Q34 • dbms-034easy • 5 sources

Which statement describes the schema of a relation?

Answer: A schema is the stable description of a relation: its name, attributes, domains and constraints.

Q35 • dbms-035easy • 5 sources

Which constraint makes a column refuse an empty value?

Answer: NOT NULL is the constraint that refuses an empty value in a column.

Q36 • dbms-036medium • 5 sources

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

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

Q37 • dbms-037medium • 5 sources

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

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

Q38 • dbms-038medium • 4 sources

What is a functional dependency?

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

Q39 • dbms-039hard • 4 sources

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

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

Q40 • dbms-040hard • 4 sources

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

Answer: 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.

DSA Tracker • https://dsatracker.tech/core-cs/dbms