Database (35) 

Welcome to our RDBMS Interview Questions and Answers Page

Here, you will find a comprehensive collection of frequently asked questions and well-crafted answers related to Relational Database Management Systems (RDBMS). Whether you are a beginner or an experienced professional, this resource will help you prepare for your upcoming interviews and enhance your understanding of RDBMS concepts.

Top 20 Basic Rdbms interview questions and answers

1. What is RDBMS?
RDBMS stands for Relational Database Management System. It is a type of DBMS that stores data in a tabular format with rows and columns, and organizes the data using relationships between tables.

2. What is a relational database?
A relational database is a database that organizes data into one or more tables with a unique key identifying each row.

3. What is a primary key?
A primary key is a unique identifier for a row in a table. It ensures that each row in a table can be uniquely identified.

4. What is a foreign key?
A foreign key is a column in a table that refers to the primary key of another table. It establishes a link between two tables.

5. What are the advantages of RDBMS?
– Data integrity: RDBMS ensures the accuracy and consistency of data.
– Data security: RDBMS provides features like authentication, authorization, and encryption to protect data.
– Data sharing: RDBMS allows multiple users to access and manipulate data concurrently.
– Data independence: RDBMS separates data structure from the application programs, providing flexibility in data management.

6. What is normalization in RDBMS?
Normalization is the process of organizing data in a database to eliminate redundancy and improve data integrity. It involves breaking down a table into multiple smaller tables and defining relationships between them.

7. What is the difference between a primary key and a unique key?
A primary key is used to uniquely identify a row in a table and cannot contain null values. On the other hand, a unique key is used to ensure the uniqueness of values in a column but can contain null values.

8. What is a transaction in RDBMS?
A transaction is a logical unit of work that consists of one or more database operations. It ensures the consistency and integrity of data by either committing the changes or rolling them back if an error occurs.

9. What is ACID in RDBMS?
ACID stands for Atomicity, Consistency, Isolation, and Durability. It is a set of properties that guarantee reliability in database transactions. Atomicity ensures that a transaction is treated as a single unit, Consistency ensures that transaction brings the database from one valid state to another, Isolation ensures that concurrent transactions do not interfere with each other, and Durability ensures that once a transaction is committed, its changes are permanent.

10. What is a join in RDBMS?
A join is an operation that combines rows from two or more tables based on a related column between them. It allows data from multiple tables to be retrieved and combined into a single result set.

11. What is the difference between DELETE and TRUNCATE commands?
The DELETE command is used to remove specific rows from a table, whereas the TRUNCATE command is used to remove all rows from a table. DELETE is a logged operation and can be rolled back, while TRUNCATE is not logged and cannot be rolled back.

12. What is a view in RDBMS?
A view is a virtual table that is based on the result of a query. It does not store any data itself but provides a way to access and manipulate data from multiple tables as if it were a single table.

13. What is a stored procedure?
A stored procedure is a set of SQL statements that are stored in the database and can be executed repeatedly. It provides a way to encapsulate complex operations and improve performance by reducing network traffic.

14. What is a trigger in RDBMS?
A trigger is a database object that automatically executes a set of actions in response to a specified event, such as inserting, updating, or deleting data in a table.

15. What is the difference between a primary key and a unique constraint?
A primary key is a column or a combination of columns that uniquely identifies each row in a table. It is used to enforce entity integrity. On the other hand, a unique constraint is used to enforce domain integrity by ensuring that the values in a column or a combination of columns must be unique but can contain null values.

16. What is the difference between a clustered and non-clustered index?
A clustered index determines the physical order of data in a table based on the indexed column. Only one clustered index can be created per table. On the other hand, a non-clustered index does not affect the physical order of data and can be created on multiple columns.

17. What is a deadlock in RDBMS?
A deadlock occurs when two or more transactions are waiting for each other to release resources, resulting in a situation where none of the transactions can proceed.

18. What is data normalization and why is it important?
Data normalization is the process of organizing data in a database to eliminate redundancy and improve data integrity. It is important because it ensures that the database is efficient, scalable, and maintains data consistency.

19. What is the difference between OLTP and OLAP?
OLTP (Online Transaction Processing) is a type of database system that is optimized for transaction processing, where the emphasis is on fast and efficient retrieval and modification of data. OLAP (Online Analytical Processing), on the other hand, is a type of database system that is optimized for complex analytical queries and data analysis.

20. What is the role of a DBA (Database Administrator)?
A DBA is responsible for managing and maintaining the database system. Their roles include installing and upgrading database software, planning and implementing backups and disaster recovery, monitoring database performance, and optimizing database design for better performance.

Top 20 Advanced Rdbms interview questions and answers

1. What is an RDBMS?
An RDBMS (Relational Database Management System) is a type of database management system that organizes data into tables with predefined relationships, allowing efficient storage, retrieval, and management of data.

2. What are the advantages of using an RDBMS?
Some advantages of using an RDBMS include data integrity, data consistency, efficient querying and indexing, easy scalability, concurrency control, and better security.

3. What is normalization in RDBMS?
Normalization is the process of organizing data in a database to reduce redundancy and dependency. It involves breaking down larger tables into smaller ones and establishing relationships between them using keys.

4. What is a primary key?
A primary key is a unique identifier for each record in a table. It ensures that each record is uniquely identified and helps in establishing relationships with other tables.

5. What is a foreign key?
A foreign key is a field in a table that refers to the primary key of another table. It establishes a relationship between the tables and ensures data integrity and consistency.

6. What is a join in RDBMS?
A join is a method used to combine data from two or more tables based on a related column between them. It allows retrieval of data from multiple tables simultaneously.

7. What is the difference between INNER JOIN and OUTER JOIN?
INNER JOIN returns only the matching records from both tables, whereas OUTER JOIN returns all records from one table and matching records from the other table.

8. What is the difference between DELETE and TRUNCATE in RDBMS?
DELETE removes specific rows from a table by specifying a condition, while TRUNCATE removes all rows from a table without any conditions. TRUNCATE is faster but cannot be rolled back.

9. Explain the ACID properties in RDBMS.
ACID stands for Atomicity, Consistency, Isolation, and Durability. These properties ensure that database transactions are completed reliably and consistently.

10. What is a stored procedure?
A stored procedure is a pre-compiled set of SQL statements that are stored in the database and can be called as a single unit. It helps in reducing network traffic and improving performance.

11. What is a trigger in RDBMS?
A trigger is a set of actions that are automatically performed when a specified event occurs in a database. It is used to enforce business rules, data integrity, and automate certain tasks.

12. What is a view in RDBMS?
A view is a virtual table created from one or more tables in a database. It is used to present data from different tables in a structured manner, without altering the original tables.

13. What is indexing in RDBMS?
Indexing is the process of creating a data structure (index) on a table to improve the speed of data retrieval. It helps in quicker search and retrieval of data based on the indexed columns.

14. What are the different types of indexes?
Some types of indexes in RDBMS are B-tree indexes, Bitmap indexes, Hash indexes, and Clustered indexes. Each type is optimized for specific query scenarios.

15. What is a deadlock in RDBMS?
A deadlock is a situation where two or more transactions are unable to proceed further because each is waiting for the other to release a resource. It can result in a system freeze or performance degradation.

16. What is data redundancy in RDBMS?
Data redundancy refers to the duplication of data in a database. It can lead to inefficient storage, update anomalies, and inconsistent data.

17. What is denormalization?
Denormalization is the process of intentionally introducing redundancy into a database to improve performance by reducing the number of joins required in queries. It trades off some of the benefits of normalization for improved query performance.

18. What is a database transaction?
A database transaction is a logical unit of work that consists of one or more database operations. It is either completed entirely or rolled back if any part of it fails.

19. Explain the concept of ACID transactions.
ACID transactions ensure that database operations are atomic (indivisible), consistent (follow business rules), isolated (no interference with other transactions), and durable (committed changes are permanent).

20. What is the difference between OLTP and OLAP?
OLTP (Online Transaction Processing) is used for routine business operations that involve short, simple database transactions, while OLAP (Online Analytical Processing) is used for complex data analysis and reporting.

Database (35) 

Interview Questions and answers