Question Bank For II Mid Exams-Dbms
Question Bank For II Mid Exams-Dbms
Module – III
1 Explain about functional dependency?
Locking Protocol
A locking protocol is a set of rules governing how transactions acquire
and release locks on data items to ensure serializability and prevent
conflicts in concurrent environments.
Purpose: To ensure data consistency and avoid conflicts in concurrent
transactions.
Transaction
A transaction is a sequence of database operations treated as a single
unit, ensuring consistency and integrity. Either all operations are
completed, or none are executed.
ACID Properties:
1. Atomicity: All operations in a transaction are executed or none at
all.
2. Consistency: The transaction ensures the database moves from
one valid state to another.
3. Isolation: Transactions are independent, with no interference
from others.
4. Durability: Once committed, changes are permanent, even in
case of a crash.
3 Write about Log based recovery?
Serializability:
Serializability ensures that the result of executing concurrent
transactions is the same as if they were executed serially.
Types:
1. Conflict Serializability: Transactions can be reordered
without conflicts.
2. View Serializability: Transactions produce the same result
as some serial execution.
Schedules:
A schedule is the order of operations from multiple transactions.
Types:
1. Valid Schedule: Follows consistency rules.
2. Conflict Serializable Schedule: Can be rearranged to a serial order
without conflicts.
3. Recoverable Schedule: Commits transactions only after all
dependencies are written.
Module – V
1 What is primary and secondary indexing?
Features of B+ Trees
1. Balanced: All leaf nodes are at the same level.
2. Sorted Data: Enables efficient search and range queries.
3. Leaf Nodes Linked: Provides fast sequential access.
4. Internal Nodes Store Only Keys: Data is stored in leaf nodes.
5. Efficient Operations: Logarithmic time for search, insert, and
delete.
6. Supports Range Queries: Linked leaves allow fast range
queries.
7. High Fan-out: Reduces tree height and improves
performance.
3 Explain difference between indexing and hashing?
4 What is an index on a file of records? Why is it needed?
Why Needed:
Faster Retrieval
Efficient Queries
Improved Performance
Optimized Access
5 Define Types of Indexing
Types of Indexing
1. Single-Level Indexing: One index points directly to data records.
2. Multi-Level Indexing: Indexes point to other indexes, reducing access
time.
3. Clustered Indexing: Data is ordered by the index key.
4. Non-Clustered Indexing: Index is separate from data records.
5. B-Tree Indexing: Tree structure for efficient search, insert, and delete.
6. B+ Tree Indexing: B-Tree variant with linked leaves for faster range
queries.
7. Hashing: Index based on hash functions for exact match queries.
Bloom
Q. PO
PART-B ( 5 Mark Question) Marks ’s COs
No s
Level
Module – III
Example:
A table storing Course, Teacher, and Book where a course can have
multiple teachers and books:
Solution:
Split into two tables:
Courses-Teachers:
Courses-Books:
5th Normal Form (5NF):
A table is in 5NF if:
1. It is in 4NF.
2. It has no join dependency anomalies.
Example:
A table storing Project, Task, and Team Member:
Solution:
Split into three tables:
Projects-Tasks:
Tasks-Team Members:
Projects-Team Members:
Converted to 1NF:
2nd Normal Form (2NF):
A relation is in 2NF if:
1. It is in 1NF.
2. There are no partial dependencies: No non-
prime attribute (non-key column) depends only on
part of a composite primary key.
Example:
Non-2NF table:
Course:
Functional Dependencies:
1. StudentID, CourseID → Instructor, Dept (Primary key).
2. Instructor → Dept (BCNF violation because Instructor is not a
superkey).
Steps to Convert to BCNF:
1. Decompose based on Instructor → Dept:
o Table 1: Instructor, Dept.
o Table 2: StudentID, CourseID, Instructor.
Resulting Tables in BCNF:
Lossless-Join Decomposition
A decomposition of a relation schema R into two relation schemas
X and Y is lossless-join if the natural join of X and Y results in the
original relation R without any loss of information.
Example of Lossless-Join:
Relation R:
Functional Dependencies:
1. StudentID,CourseID→Instructor
2. Instructor→Dept
Decomposition:
1. X={Instructor,Dept}
2. Y={StudentID,CourseID,Instructor}
Testing Lossless-Join:
X∩Y={Instructor}
Instructor→Dept(Instructor is a superkey in X).
Thus, the decomposition is lossless-join.
Example of Lossy Decomposition:
If X={StudentID,CourseID} and Y={Instructor,Dept}:
X∩Y=∅.
No superkey condition can be satisfied.
This decomposition is not lossless-join and would result in
spurious tuples.
5 Explain in detail about 1NF, 2NF and 3NF with suitable examples. Find
the highest normal form in R(A, B, C, D, E) under following functional
dependencies.
ABC -> D
CD -> AE
Module – IV
Module – V
1 Give a comparison of various file organizations.
Pros of ISAM:
Cons of ISAM:
3 Construct a B+ tree to insert the following key elements (order of the tree
is 3)
5, 9, 12, 16, 21, 25, 32, 34, 38, 42, 51, 55, 61, 65
4 Explain what are the differences between tree based and Hash based
indexes?