Top Database (DBMS) Interview Questions and Answers

Here are top interview questions on DBMS. 


1. What is a database?

A database is a structured collection of data organized and stored in a way that allows for efficient retrieval and manipulation of information.

 

2. What are the advantages of using a database management system (DBMS)?

DBMS provides data integrity, security, data sharing, data consistency, and helps in reducing data redundancy.

 

3. What is a primary key?

A primary key is a unique identifier for each record in a database table. It ensures that each row in the table is uniquely identifiable.

 

4. What is a foreign key?

A foreign key is a column or set of columns in a table that refers to the primary key of another table. It establishes a relationship between two tables.

 

5. What is normalization?

Normalization is the process of organizing data in a database to eliminate redundancy and dependency issues, ensuring data integrity and efficiency.

 

6. What is ACID in the context of databases?

ACID stands for Atomicity, Consistency, Isolation, and Durability. It is a set of properties that ensure database transactions are processed reliably.

 

7. Explain the difference between a clustered and a non-clustered index.

A clustered index determines the physical order of data in a table, while a non-clustered index is a separate structure that provides a quick lookup to data.

 

8. What are stored procedures?

Stored procedures are pre-compiled and stored database objects that contain one or more SQL statements. They can be called and executed from applications.

 

9. What is the purpose of the "GROUP BY" clause in SQL?

The "GROUP BY" clause is used to group rows based on specified columns, usually accompanied by aggregate functions like COUNT, SUM, AVG, etc.

 

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

SQL databases are relational and use structured query language, while NoSQL databases are non-relational and often use JSON or other formats for data storage.

 

11. Define data integrity in databases.

Data integrity ensures the accuracy, consistency, and validity of data in a database, preventing data corruption or unauthorized modifications.

 

12. What is a transaction in the context of databases?

A transaction is a sequence of one or more database operations that must be executed as a single unit of work. It should either complete entirely or not at all.

 

13. Explain the concept of a database schema.

A database schema defines the structure of a database, including tables, fields, data types, and relationships between tables.

 

14. What are the different types of joins in SQL?

The common types of joins in SQL are INNER JOIN, LEFT JOIN (or LEFT OUTER JOIN), RIGHT JOIN (or RIGHT OUTER JOIN), and FULL JOIN (or FULL OUTER JOIN).

 

15. How can you optimize database performance?

Performance optimization techniques include creating indexes, denormalization, using caching, optimizing queries, and hardware upgrades.

 

16. What is a view in a database?

A view is a virtual table created by a query. It does not store data itself but presents the data from one or more underlying tables.

 

17. What is the purpose of the SQL "HAVING" clause?

The "HAVING" clause is used in combination with the "GROUP BY" clause to filter the results of aggregate functions based on specified conditions.

 

18. What is a database trigger?

A database trigger is a set of actions that automatically execute in response to specific events, such as insert, update, or delete operations on a table.

 

19. What is the difference between a database backup and a database restore?

A database backup creates a copy of the database for disaster recovery purposes, while a database restore involves using that backup to recover the database to a previous state.

 

20. What are the common database design patterns?

Some common database design patterns include Singleton, Repository, Observer, and Factory patterns, each serving specific architectural and data handling purposes.


Above are few top DBMS interview questions. Remember to prepare and expand on these answers.

Good luck with your interview!  👍

Post a Comment

0 Comments