DBMS CS
DBMS CS
20. What are the advantages of using a NoSQL database over an RDBMS?
Answer: NoSQL databases offer flexibility, scalability, and better performance for
unstructured or semi-structured data compared to traditional RDBMS.
Bonus Questions:
Explain the purpose of the SQL JOIN clause in DBMS.
Answer: The JOIN clause in SQL is used to combine rows from two or more tables
based on a related column between them. It allows data from different tables to be
retrieved together to create more comprehensive result sets.
What are the advantages and disadvantages of using stored procedures in a DBMS?
Answer: Advantages of stored procedures include improved performance (as they are
precompiled), reduced network traffic (since the code resides on the server), and
enhanced security (as users only need execute permissions). However, disadvantages
include increased complexity and maintenance overhead, limited portability across
different database systems, and a potential lack of direct debugging capabilities.
What are the different types of locks in a DBMS, and how do they affect data
concurrency?
Answer: The main types of locks are:
Shared Lock (Read Lock): Allows multiple transactions to read data simultaneously
but not modify it.
Exclusive Lock (Write Lock): Only one transaction can acquire this lock, preventing
other transactions from reading or writing the locked data.
Update Lock: A hybrid lock that allows multiple transactions to read the data but
prevents concurrent updates.
Intent Lock: Indicates that a transaction intends to acquire a higher-level lock to
protect a range of data.
Locks play a vital role in managing data concurrency. Shared locks promote data
read consistency, allowing multiple transactions to read the same data
simultaneously. Exclusive locks ensure data integrity by preventing multiple
transactions from modifying the same data simultaneously. However, excessive or
poorly managed locks can lead to contention and performance issues, impacting the
overall database performance. Proper lock management and lock escalation techniques
are essential for efficient data concurrency control.