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.
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.
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.
What are the ACID properties of a transaction?
Answer: ACID stands for atomicity, consistency, isolation and durability, the four guarantees that make transactions reliable.
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.
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.
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.
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.
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.
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.
Which SQL sublanguage contains the GRANT and REVOKE commands?
Answer: GRANT and REVOKE belong to DCL, the data control language.
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.
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.
Which statement about a primary key is always true?
Answer: A primary key uniquely identifies each row and can never be NULL.
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.
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.
Which shape represents an entity in a standard entity-relationship diagram?
Answer: Entities are drawn as rectangles, attributes as ovals and relationships as diamonds.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Which statement describes the schema of a relation?
Answer: A schema is the stable description of a relation: its name, attributes, domains and constraints.
Which constraint makes a column refuse an empty value?
Answer: NOT NULL is the constraint that refuses an empty value in a column.
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.
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.
What is a functional dependency?
Answer: A functional dependency X -> Y means that any two rows agreeing on X must also agree on Y.
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.
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.