0% found this document useful (0 votes)
24 views6 pages

DBMS B

Uploaded by

shuvronil562
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views6 pages

DBMS B

Uploaded by

shuvronil562
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1.

What is the key difference between a primary index and a secondary index in a
database System?
❖ The main difference between a primary index and a secondary index in a database
management system (DBMS) is that a primary index is used to uniquely identify
records, while a secondary index is used to improve query performance.
2. Consider a B+ tree in which the maximum number of keys in a node is 5. What is
the minimum number of keys in any non-root node?
❖ The maximum number of keys per node is 5.
To find the minimum number of keys in any non-root node, we need to calculate
⌈(m+1)/2⌉, where m = 5.
⌈(5+1)/2⌉ = ⌈3⌉ = 3
Therefore, the minimum number of keys in any non-root node of a B⁺ tree with a
maximum of 5 keys per node is 3.
3. Given a B-tree where each node can contain at most 5 keys, determine the
order of the B-tree

4. What is the difference between a “committed” transaction and a “rolled-back”


transaction in the context of transaction control?
❖ In transaction control, the difference between a committed transaction and a
rolled-back transaction is that a committed transaction applies all of its operations
to the database, while a rolled-back transaction does not apply any of its
operations.
5. What is two-phase locking (2PL) in transaction control, and how does it help in
ensuring transaction isolation?
❖ Two-phase locking (2PL) is a concurrency control method used in database systems
to ensure transaction serializability. Transaction serializability ensures that even
when database transactions overlap in time, the final result looks if they had
occurred one after another in sequence.
6. Explain what is meant by serializability in transaction control and why it is
important.
❖ Serializability in transaction control is a property of database transactions that
ensures the final state of the database is consistent, regardless of the order in which
transactions are executed. It’s important because it prevents data inconsistencies
and anomalies that can occur when multiple transactions try to access and modify
the same data at the same time.
7. What is the purpose of a lock in transaction control? Explain how locks help in
ensuring the isolation property of transactions.
❖ The purpose of a lock in transaction control is to ensure that transactions are
executed in isolation from each other, preventing conflicts and data
inconsistencies. Locks are variables that track the status of data items, and are
used to manage access to data elements in a transaction.
8. What is the difference between shared lock and exclusive lock in locking
protocols?

The main difference between shared and exclusive locks is that shared locks allow
multiple transactions to read data, while exclusive locks allow only one transaction to
modify data:

Shared locks

Allow multiple transactions to read the same data, but prevent any transaction from
modifying it. Shared locks are also known as read-only locks.

Exclusive locks

Allow a transaction to modify the data, but prevent any other transaction from reading
or modifying it. Exclusive locks are also known as read and write locks.

9. What is the primary objective of the timestamp ordering protocol in a database


management system (DBMS)?
❖ The primary objective of the timestamp ordering protocol in a database
management system (DBMS) is to ensure that transactions are executed in a
consistent order, preventing conflicts.
10. What is lock point in a transaction schedule?
❖ In a transaction schedule, the lock point is the moment when a transaction
transitions from the growing phase to the shrinking phase. This occurs when the
transaction acquires its final lock and is ready to begin its work.

1.Highlight the benefits of using a DBMS over traditional file systems.

❖ A Database Management System (DBMS) has several advantages over traditional


file systems, including:

Data redundancy reduction


DBMS stores each piece of data only once, which reduces confusion and wasted
storage space.

Data security

DBMS provides multiple levels of security authentication at the user and admin levels to
help avoid security breaches.

Data integrity

DBMS ensures the consistency and accuracy of data within the database by enforcing
rules and constraints on the data.

Data sharing

DBMS provides quick solutions to database queries, enabling faster access to more
accurate data.

Recovery and backup

DBMS provides a separate process for backing up and recovering data from that of a
network backup.

Scalability

DBMS can manage huge workloads, more concurrent users, and complex queries.

Concurrent access

DBMS allows multiple users to access the same data simultaneously.

2. Compare the use of primary and foreign key constraints in ensuring data integrity.

❖ Primary and foreign key constraints are both important for ensuring data integrity in
a database:
Primary key constraints
Ensure that each record in a table is unique, preventing duplicate entries. A primary
key is a column or combination of columns that uniquely identifies each row in a
table.
Foreign key constraints
Establish and enforce a link between the data in two tables. A foreign key is a
column or combination of columns that references the primary key in another table.
3.Consider a relation R(A, B, C, D, E, F) with the following functional dependencies.
Determine the

Total number of super keys for the relation R: F = {A → BC, B → D, D → E, A → F, E → C}

4. Compare JOIN and Correlated Subquery in SQL.

❖ A JOIN is a means for combining fields from two tables by using values common to
each. Subqueries can be slower than JOINs, especially if the subquery returns a
large number of rows. JOINs are generally faster than subqueries, especially for
large datasets.

5. Explain your understanding of Dense Clustering and Sparse Clustering.

❖ Data points that belong to small or very sparse clusters or that are far away from
their assigned cluster can be considered anomalies. Density-based methods like
Expectation Maximization are used to identify data points in dense regions as
normal and those in low-density regions as anomalies.

6. Explain the purpose of the cartesian product in relational algebra.

❖ In relational algebra, the Cartesian product operation combines two relations to


create a new table that contains all possible combinations of the tuples from each
relation:

Purpose: The Cartesian product is a building block for more complex operations, such as
joins.

How it works: The Cartesian product combines every row from one table with every row
from another table. The result is a new table where each combination has its own row.

Also known as: The Cartesian product is also called the cross product or cross join.

7. Define the degree and cardinality of a relation.

❖ In a relation, the degree is the number of attributes or columns, while the cardinality
is the number of tuples or rows:

Degree
The number of attributes or columns in a relation is called the degree of the relation.
It is also sometimes called the arity or width.

Cardinality

The number of tuples or rows in a relation is called the cardinality of the relation. It is
sometimes called the size or row count.

8. Explain dense clustering and its significance in database indexing.

❖ A dense index in databases is a file with pairs of keys and pointers for every record in
the data file. Every key in this file is associated with a particular pointer to a record in
the sorted data file. In clustered indices with duplicate keys, the dense index points
to the first record with that key.

9. Given the relation R(X, Y, Z, W) with functional dependencies {X → Y, Y → Z, Z → W,


W → X},

determine the normalization form of the given relation.

10.Describe the augmentation axiom in Armstrong’s axioms.

❖ The augmentation axiom in Armstrong’s axioms states that if A → B is true, then AC →


BC is also true for any C. This means that adding attributes to both A and B does not
change the functional dependency.

11.Explain the purpose of the referential integrity in DBMS.

❖ Referential integrity (RI) in a database management system (DBMS) ensures that


data in related tables is consistent and accurate:

Maintains relationships

RI ensures that each foreign key in a child table corresponds to a primary key in the
parent table. This helps maintain accurate relationships and data flow.

Prevents errors

RI prevents users from navigating to “dead ends” and helps prevent incorrect records
from being added, deleted, or modified.

12.Highlight the problems in Basic 2-Phase locking protocol.


❖ Two-phase locking may also limit the amount of concurrency that occurs in a
schedule because a Transaction may not be able to release an item after it has used
it. This may be because of the protocols and other restrictions we may put on the
schedule to ensure serializability, deadlock freedom, and other factors.

You might also like