Top DBMS Interview Questions & Answers (2026)

Beginner 52 Questions Fresher Friendly Updated Oct 2026
Search by question or keyword.

Interview Questions and Answers

Expand a question to view the answer and interview tip.

1. Limitations of File-Based Systems

File-based systems store data in individual files for each application. Limitations include:

  1. Data Redundancy & Inconsistency

    • Same data may be stored in multiple files, causing duplication and inconsistencies.

  2. Difficulty in Data Access

    • Accessing data requires writing custom programs. Complex queries are hard to implement.

  3. Data Isolation

    • Data is scattered across files, making it difficult to access data across multiple files.

  4. Integrity Problems

    • Hard to enforce data integrity (like unique IDs or constraints) in file-based systems.

  5. Concurrent Access Issues

    • Multiple users cannot safely access or update files at the same time.

  6. Security Issues

    • File-based systems have limited support for user authentication and access control.


2. How Database Approach Resolves Limitations

File-Based System LimitationDBMS Solution
Data redundancy & inconsistencyDBMS stores centralized data, reducing duplication.
Difficulty in data accessProvides query languages (like SQL) for easy data retrieval.
Data isolationUnified database structure allows access to related data across tables.
Integrity problemsDBMS enforces constraints like primary keys, foreign keys, and rules.
Concurrent access issuesDBMS handles multi-user concurrency control and transactions.
Security issuesDBMS provides user authentication and access control mechanisms.

3. Physical Architecture of a DBMS

The physical architecture defines how data and DBMS components are organized and accessed:

Components:
  1. Hardware

    • Servers, storage devices, CPU, memory where DBMS and data reside.

  2. DBMS Software

    • Core system managing database operations:

      • Storage Manager: Manages data storage, buffering, and retrieval.

      • Query Processor: Parses and executes queries.

      • Transaction Manager: Ensures ACID properties.

  3. Data

    • Stored in files or tables on storage devices.

    • Organized logically into tables, indexes, views.

  4. Users / Applications

    • End Users: Use applications to interact with DBMS.

    • Application Programs: Connect via APIs (like JDBC) to perform operations.


Physical Architecture Diagram (Simplified)

[Users / Applications] | [Query Processor] | [Transaction Manager] | [Storage Manager] | [Data Files]
  • Queries from users pass through the query processor → transaction manager ensures consistency → storage manager handles reading/writing to physical storage.


Summary:

  • File-based systems have redundancy, inconsistency, poor security, and limited access.

  • DBMS centralizes data, enforces constraints, supports concurrency, and provides easy access.

  • Physical architecture includes users, DBMS software, and storage hardware interacting to manage data efficiently.

Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

(i) Key Constraints

  • A key is an attribute (or set of attributes) that uniquely identifies a tuple (row) in a relation (table).

  • Constraint: No two tuples can have the same value for the key.

Example:
Table: Student(ID, Name, Age)

  • Key: ID → ensures each student has a unique ID.

IDNameAge
101John20
102Alice21

(ii) Domain Constraints

  • A domain constraint specifies that values of an attribute must come from a predefined domain (type or set of allowed values).

Example:

  • Age in Student table → must be an integer between 18 and 25.

  • Gender → only Male or Female.


(iii) Candidate Key

  • A candidate key is a minimal set of attributes that can uniquely identify a tuple.

  • A relation can have multiple candidate keys; one is chosen as the primary key.

Example:
Table: Student(ID, RollNo, Email, Name)

  • Candidate keys: ID, RollNo, Email → any of these can uniquely identify a student.


(iv) Select Operation (σ)

  • Select (σ) returns tuples that satisfy a given condition.

  • Notation: σ_condition(Relation)

Example:
Table: Student(ID, Name, Age)

  • Query: σ_Age>20(Student) → Students with Age > 20

IDNameAge
102Alice21

(v) Project Operation (π)

  • Project (π) returns specific columns (attributes) from a relation.

  • Notation: π_attributeList(Relation)

Example:
Table: Student(ID, Name, Age)

  • Query: π_Name(Student) → Only names of students

Name
John
Alice

(vi) Equijoin Operation

  • Combines tuples from two relations based on equality of attributes.

Example:
Table1: Student(ID, Name)
Table2: Marks(ID, Score)

  • Query: Join on ID → Student ⨝ Student.ID = Marks.ID Marks

IDNameScore
101John80
102Alice90

(vii) Set Difference Operation (-)

  • Returns tuples in one relation but not in another.

Example:
Table1: AllStudents(ID) → {101, 102, 103}
Table2: PassedStudents(ID) → {101, 102}

  • AllStudents - PassedStudents → {103}


(viii) Referential Integrity Constraint

  • Ensures foreign key values in one table exist as primary key values in another table.

  • Prevents orphan records.

Example:
Table1: Student(ID, Name) → Primary Key: ID
Table2: Marks(StudentID, Score) → StudentID is foreign key referencing Student(ID)

  • Marks.StudentID must exist in Student.ID.

Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

DBMS is software used to store, manage, and retrieve data efficiently.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

RDBMS stores data in tables with rows and columns and supports relationships between them.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A database is an organized collection of structured data stored electronically.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A table stores data in rows and columns inside a database.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A primary key uniquely identifies each record and cannot be NULL.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A foreign key links one table to another and enforces referential integrity.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A candidate key is any attribute that can uniquely identify a row in a table.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A super key is a set of one or more attributes that uniquely identifies each row.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A composite key uses two or more columns to uniquely identify a record.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

NULL represents missing, unknown, or undefined data.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

SQL is Structured Query Language used to communicate with databases.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

DDL commands define structure: CREATE, ALTER, DROP.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

DML commands manipulate data: SELECT, INSERT, UPDATE, DELETE.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

DCL commands control permissions: GRANT, REVOKE.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A view is a virtual table created using a SQL query.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Normalization reduces data redundancy and improves data integrity.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Denormalization improves read speed by adding redundant data.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

1NF requires atomic values and no repeating groups.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

2NF removes partial dependency from composite primary keys.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

3NF removes transitive dependencies among non-key attributes.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

BCNF is a stricter form of 3NF ensuring every determinant is a candidate key.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A transaction is a set of operations executed as a single logical unit.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Atomicity, Consistency, Isolation, Durability ensure reliable transactions.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A join combines rows from two or more tables based on related columns.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

INNER returns matching records; LEFT returns all left records plus matches.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Referential integrity ensures foreign keys correctly reference primary keys.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

An index improves search speed using data structures like B-Trees.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Clustered index sorts and stores table data physically.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Non-clustered index stores pointers to actual data rows.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Stored procedure is precompiled SQL code stored inside the database.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Trigger executes automatically on INSERT, UPDATE, or DELETE operations.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A cursor handles row-by-row processing in SQL.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

DELETE removes rows one by one; TRUNCATE removes all rows instantly.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

NATURAL JOIN joins based on same column names; INNER JOIN requires explicit condition.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Schema defines database structure including tables, constraints, and relationships.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Deadlock occurs when two transactions wait indefinitely for each other to release locks.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Use timeouts, lock ordering, and smaller transactions to avoid deadlock.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

2PC ensures distributed transactions are consistent across multiple databases.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Concurrency control manages simultaneous transactions to maintain consistency.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Locking restricts access to data to maintain consistency during transactions.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Shared lock allows read; exclusive lock allows write and blocks others.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Indexes speed reads but slow writes and require extra storage.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Hashing maps keys to memory addresses for fast record retrieval.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

RAID is a disk storage technique improving reliability and performance.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

OLTP handles real-time transaction-based operations.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

OLAP supports analytical and complex queries used for reporting.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

OLTP is transactional; OLAP is analytical for decision making.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

A surrogate key is an artificially generated unique identifier.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Data independence allows schema changes without affecting applications.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.

Includes external, conceptual, and internal levels representing views, structure, and physical storage.
Interview Tip: Keep your answer structured and support it with practical examples wherever possible.
Share this Post

Ready to Learn and Practice?

Watch tutorials, practice with quizzes, and prepare for competitive exams with Quizer.in.