0% found this document useful (0 votes)
30 views9 pages

Database Indexing and Transaction Management

Uploaded by

meethsuvarna2
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)
30 views9 pages

Database Indexing and Transaction Management

Uploaded by

meethsuvarna2
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

1. Which of the following file organization is best for bulk insert operations?

A) Sorted File
B) Heap File
C) Hashed File
D) Clustered File
Answer: B

2. What is the primary purpose of an index in database systems?


A) To reduce storage space
B) To provide backup
C) To speed up data retrieval
D) To secure data
Answer: C

3. Which file organization method is most suitable for range queries?


A) Heap File
B) Sorted File
C) Hashed File
D) Bitmap Index
Answer: B

4. What is a clustered index?


A) An index built on non-primary attributes
B) An index where the physical order of data matches the index order
C) An index stored in a separate file
D) A hash-based index
Answer: B

5. Which data structure is commonly used for indexing in databases?


A) Linked List
B) Stack
C) B+ Tree
D) Queue
Answer: C

6. What type of queries is a hashed file organization inefficient for?


A) Equality-based queries
B) Bulk insert queries
C) Range-based queries
D) None of the above
Answer: C

7. What is the main difference between a B-Tree and a B+ Tree?


A) B+ Tree is unbalanced
B) B+ Tree stores all keys in leaf nodes
C) B+ Tree does not allow sequential access
D) B+ Tree is faster for updates
Answer: B
8. Which of the following is NOT a characteristic of a B+ Tree?
A) Leaf nodes are linked
B) All paths from root to leaves are of equal length
C) Keys are stored only in leaf nodes
D) Supports only equality searches
Answer: D

9. What type of index is created on non-primary key attributes?


A) Primary Index
B) Secondary Index
C) Clustered Index
D) Bitmap Index
Answer: B

10. Which index type is most suitable for low-cardinality attributes?


A) Hash Index
B) Bitmap Index
C) B+ Tree
D) Heap File
Answer: B

11. Which file organization uses a hash function for record placement?
A) Heap File
B) Sorted File
C) Hashed File
D) Clustered File
Answer: C

12. What is the time complexity of searching in a B+ Tree?


A) O(log n)
B) O(n)
C) O(1)
D) O(n log n)
Answer: A

13. What happens when a new record is inserted into a full node of a B+ Tree?
A) The record is discarded
B) The node splits
C) The tree becomes unbalanced
D) The record is stored in a temporary buffer
E) Answer: B

14. Which file organization is most suitable for sequential access?


A) Heap File
B) Sorted File
C) Hashed File
D) Bitmap Index
Answer: B

15. What is the primary advantage of using a B+ Tree for indexing?


A) Faster bulk loading
B) Efficient sequential and range queries
C) Reduced storage space
D) Simpler implementation
Answer: B

16. In a B+ Tree, what is the purpose of linking leaf nodes?


A) To allow random access
B) To simplify insertion
C) To facilitate sequential access
D) To improve hash-based searches
Answer: C

17. What happens during a deletion in a B+ Tree if a node becomes underfull?


A) The node is merged with a sibling
B) The tree is rebalanced
C) The node is split
D) The deletion fails
Answer: A

18. What type of index is stored in a separate file?


A) Clustered Index
B) Non-clustered Index
C) Primary Index
D) Sorted File
Answer: B

19. Which indexing method is best for dynamic datasets?


A) Hash Indexing
B) Bitmap Indexing
C) B+ Tree Indexing
D) Sorted File
Answer: C

20. What is the main disadvantage of a heap file organization?


A) Inefficient for bulk loading
B) High maintenance cost
C) Poor search performance
D) Difficult to implement
E) Answer: C

21. Query ___ is the activity performed in extracting data from the database.

a) Result
b) Inhibition
c) System
d) Processing

Answer: D) Processing
22. What is/are the step(s) involved in fetching the data from the database in query
processing?

a) Parsing and translation


b) Optimization
c) Evaluation
d) All of the above

Answer: D) All of the above

23. The queries are translated into ___ expressions at the level of the file system,
which are used there as well.

a) Virtual
b) Real
c) Physical
d) None

Answer: C) Physical

24. As soon as the queries are translated, they are evaluated and various ___
transformations are performed.

a) Query-realizing
b) Query-optimizing
c) Query-deoptimizing
d) Query-deletion

Answer: B) Query-optimizing

25. An ___ representation of a query is best suited to relational algebra.

a) External
b) Internal
c) Both A and B
d) None of the above

Answer: B) Internal

26. Similar to a query parser, ___ is important in query processing.

a) Transmission
b) Translation
c) Transfusion
d) Transcreation

Answer: B) Translation

27. An '_____' is a tree of the query that the parser creates.

a) Parse-tree
b) Query-tree
c) Tree
d) None

Answer: A) Parse-tree

28. To evaluate the translated ___ expression, it must be annotated with the
instructions used to specify and evaluate each operation along with the
translation.

a) Analytical algebra
b) Relational algebra
c) Both A and B
d) None of the above

Answer: B) Relational algebra

29. Depending on the assessment plan, annotations can be added to specify the
algorithm to be used for the particular ____.

a) Index
b) Operation
c) Both A and B
d) None of the above

Answer: C) Both A and B

30. To generate the output of a query, a ___ is responsible.

a) Query execution engine


b) Query execution motor
c) Query execution train
d) None

Answer: A) Query execution engine

31. An efficient query evaluation plan is generated by a database system, which


minimizes its costs and it is known as -

a) Query evaluation
b) Query optimization
c) Query parser
d) Query translation

Answer: B) Query optimization

32. Collections of operations that form a single logical unit of work are called
__________
a) Views
b) Networks
c) Units
d) Transactions
Answer: d

33. The “all-or-none” property is commonly referred to as _________


a) Isolation
b) Durability
c) Atomicity
d) None of the mentioned
Answer: c

34. Which of the following is a property of transactions?


a) Atomicity
b) Durability
c) Isolation
d) All of the mentioned
Answer: d

35. Execution of translation in isolation preserves the _________ of a database


a) Atomicity
b) Consistency
c) Durability
d) All of the mentioned
Answer: b

36. Which of the following is not a property of a transaction?


a) Atomicity
b) Simplicity
c) Isolation
d) Durability
Answer: b

37. Which of the following systems is responsible for ensuring durability?


a) Recovery system
b) Atomic system
c) Concurrency control system
d) Compiler system
Answer: a

38. Which of the following systems is responsible for ensuring isolation?


a) Recovery system
b) Atomic system
c) Concurrency control system
d) Compiler system
Answer: c
39. A transaction that has not been completed successfully is called as _______
a) Compensating transaction
b) Aborted transaction
c) Active transaction
d) Partially committed transaction
Answer: b

40. Which of the following is not a transaction state?


a) Active
b) Partially committed
c) Failed
d) Compensated
Answer: d

41. The execution sequences in concurrency control are termed as ________


a) Serials
b) Schedules
c) Organizations
d) Time tables
Answer: b.

42. The scheme that controls the interaction between executing transactions is called
as _____
a) Concurrency control scheme
b) Multiprogramming scheme
c) Serialization scheme
d) Schedule scheme
Answer: a

43. What is the main benefit of allowing concurrent execution of transactions in a


DBMS?
a) Increased isolation
b) Increased consistency
c) Increased resource utilization and throughput
d) Increased redundancy
Answer: c) Increased resource utilization and throughput
44. Which problem does NOT arise due to concurrent execution of transactions?
a) Dirty reads
b) Deadlocks
c) Data inconsistency
d) Increased storage requirements
Answer: d) Increased storage requirements
45. Which of the following ensures the isolation property in concurrent transaction
execution?
a) Recovery algorithms
b) Concurrency control mechanisms
c) Deadlock detection mechanisms
d) Buffer management
Answer: b) Concurrency control mechanisms
46. Which of the following locks allows both read and write operations?
a) Shared lock
b) Exclusive lock
c) Read-only lock
d) Write lock
Answer: b) Exclusive lock
47. What is the purpose of using locks in a DBMS?
a) To increase the speed of transactions
b) To prevent conflicts between concurrent transactions
c) To recover from system failures
d) To reduce the size of the database
Answer: b) To prevent conflicts between concurrent transactions
48. If a transaction holds a shared lock on a data item, which operation is permitted
for other transactions?
a) Read
b) Write
c) Delete
d) Update
Answer: a) Read
49. What is the primary rule of the two-phase locking (2PL) protocol?
a) No locks can be acquired during the unlocking phase
b) All locks must be released before committing the transaction
c) Only one lock can be held at a time
d) Locks can be acquired or released in any order
Answer: a) No locks can be acquired during the unlocking phase
50. Which of the following is NOT true about strict two-phase locking (S2PL)?
a) It avoids cascading rollbacks
b) All exclusive locks are held until the transaction commits
c) It ensures serializability
d) It allows transactions to release locks before completion
Answer: d) It allows transactions to release locks before completion
51. What is the main drawback of the two-phase locking protocol?
a) Lack of serializability
b) Increased risk of deadlocks
c) Increased risk of dirty reads
d) Reduced isolation
Answer: b) Increased risk of deadlocks
52. What is the key requirement for a schedule to be considered serializable?
a) All transactions must execute sequentially
b) The schedule must produce the same result as some serial schedule
c) Transactions must be executed in timestamp order
d) All conflicts must be resolved automatically
Answer: b) The schedule must produce the same result as some serial schedule
53. A schedule is recoverable if:
a) It allows cascading rollbacks
b) Transactions commit only after ensuring all dependent transactions have committed
c) It avoids all types of locks
d) It prevents all forms of concurrency
Answer: b) Transactions commit only after ensuring all dependent transactions have
committed
54. Which of the following schedules is NOT conflict-serializable?
a) A schedule with no conflicting operations
b) A schedule where transactions are serialized based on a precedence graph
c) A schedule where two transactions read and write the same data item
simultaneously
d) A schedule equivalent to a serial schedule
Answer: c) A schedule where two transactions read and write the same data item
simultaneously

You might also like