Basic DBMS Interview Questions and Answers

1. What is DBMS?

DBMS is software that manages and organizes data in databases, ensuring efficient storage, retrieval, and updating.

2. What are the types of DBMS?

  • Relational DBMS (RDBMS): Data in tables.
  • Hierarchical DBMS: Tree structure.
  • Network DBMS: Graph structure.
  • Object-oriented DBMS: Object representation.

3. What is a database schema?

A schema defines the logical structure of a database, including tables, fields, relationships, and constraints.

4. What is normalization in DBMS?

Normalization organizes data to reduce redundancy and improve integrity using forms like 1NF, 2NF, and 3NF.

5. What is a primary key in DBMS?

A primary key uniquely identifies each record in a table and ensures data integrity.

6. What are foreign keys in DBMS?

A foreign key is a field in one table that references the primary key of another table, ensuring referential integrity.
SQL (Structured Query Language) is used to query and manipulate data in RDBMS systems.

8. What is the difference between DDL and DML?

  • DDL (Data Definition Language): Defines structure (e.g., CREATE, ALTER).
  • DML (Data Manipulation Language): Modifies data (e.g., INSERT, UPDATE).

9. What is indexing in DBMS?

Indexing improves data retrieval speed by creating a data structure (like B-tree) to locate rows efficiently.

10. What is ACID in DBMS?

  • Atomicity: Transactions are all-or-nothing.
  • Consistency: Maintains valid states.
  • Isolation: Concurrent transactions don’t interfere.
  • Durability: Changes persist after completion.


11. What is a transaction in DBMS?

A transaction is a unit of work performed within a database, adhering to the ACID properties.


12. What is a stored procedure in DBMS?

A stored procedure is a precompiled SQL code stored in the database and executed on demand.


13. What is a deadlock in DBMS?

A deadlock occurs when two or more transactions are waiting for resources held by each other, causing a standstill.

14. What are triggers in DBMS?

A trigger is a set of SQL commands that execute automatically in response to specific database events.

15. What is a clustered index?

A clustered index arranges the data in the table physically in the order of the index.


16. What is the difference between UNION and JOIN in SQL?

  • UNION combines results from multiple queries.
  • JOIN combines data from multiple tables based on a related column.

17. What is the difference between SQL and NoSQL databases?

  • SQL: Structured, relational, uses schemas.
  • NoSQL: Unstructured, non-relational, schema-less.

18. What is a view in DBMS?

A view is a virtual table derived from SQL queries without storing actual data.

19. What is the purpose of normalization?

Normalization reduces data redundancy, ensures consistency, and optimizes storage.

20. How do you handle concurrency in DBMS?

Locks and timestamps are used to manage concurrent transactions and avoid conflicts.

21. What is a cursor in DBMS?

A cursor is a pointer that retrieves, updates, or processes database rows one at a time.

22. What are database constraints?

Constraints like NOT NULL, UNIQUE, CHECK, and FOREIGN KEY ensure data integrity in DBMS.

23. What is denormalization in DBMS?

Denormalization optimizes database performance by combining tables and reducing joins.

24. What is the use of a data warehouse in DBMS?

A data warehouse stores large datasets for analysis and reporting, supporting OLAP operations.

25. What are the advantages of DBMS?

  • Data integrity and security
  • Reduced redundancy
  • Multi-user access
  • Backup and recovery

line

Copyrights © 2024 letsupdateskills All rights reserved