Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

1. Which of the following statements is true about database transactions?

a. Transactions are used to perform multiple operations on a database atomically.


b. Transactions are not necessary for maintaining data consistency.
c. Transactions cannot be rolled back once they are committed.
d. Transactions are only used in NoSQL databases.
e. All
Answer: A. Transactions are used to perform multiple operations on a database atomically.
2. What is the purpose of the ACID properties in database transactions?
a. To ensure data is stored in alphabetical order
b. To ensure data integrity and consistency
c. To improve database performance
d. To allow for parallel processing of transactions
e. None
Answer: B. To ensure data integrity and consistency
3. Which of the following statements is true about the "commit" operation in a database
transaction?
a. It permanently saves the changes made by the transaction.
b. It cancels all changes made by the transaction.
c. It temporarily saves the changes made by the transaction.
d. It is optional and not required for transactions.
e. None
Answer: A. It permanently saves the changes made by the transaction.
4. What is the purpose of the "rollback" operation in a database transaction?
a. To permanently save the changes made by the transaction
b. To undo any changes made by the transaction
c. To mark the transaction as completed
d. To optimize the performance of the database
e. None
Answer: B. To undo any changes made by the transaction
5. Which of the following is an example of a database transaction?
a. Inserting a new record into a table
b. Updating a record in a table
c. Deleting a record from a table
d. All of the above
Answer: D. All of the above
6. In a database transaction, what is the purpose of the "isolation" property?
a. To ensure that multiple transactions can be executed concurrently
b. To prevent other transactions from accessing data that is being modified by a
transaction
c. To allow transactions to access data that is being modified by other transactions
d. To limit the number of transactions that can be executed simultaneously
Answer: B. To prevent other transactions from accessing data that is being modified by a
transaction
7. Which of the following statements is true about nested transactions?
a. Nested transactions are not supported in most database systems.
b. Nested transactions allow for transactions to be divided into smaller units.
c. Nested transactions cannot be rolled back independently of their parent transaction.
d. Nested transactions do not affect the atomicity property of transactions.
e. None
Answer: B. Nested transactions allow for transactions to be divided into smaller units.
8. What is the purpose of the "durability" property in a database transaction?
a. To ensure that changes made by a transaction are permanent
b. To allow for parallel processing of transactions
c. To improve database performance
d. To limit the number of transactions that can be executed simultaneously
e. None
Answer: A. To ensure that changes made by a transaction are permanent
9. Which of the following statements is true about distributed transactions?
a. Distributed transactions can only be executed on a single node in a distributed system.
b. Distributed transactions involve multiple databases or systems.
c. Distributed transactions do not require coordination between different systems.
d. Distributed transactions do not support ACID properties.
e. None
Answer: B. Distributed transactions involve multiple databases or systems.
10. What is the purpose of a savepoint in a database transaction?
a. To permanently save changes made by a transaction
b. To mark a point within a transaction to which you can roll back
c. To commit all changes made by a transaction
d. To optimize the performance of the database
Answer: B. To mark a point within a transaction to which you can roll back
11. What is the purpose of a database transaction?
a. To retrieve data from the database
b. To perform complex calculations
c. To ensure data consistency and integrity
d. To create new database tables
Answer: c) To ensure data consistency and integrity
12. Which of the following properties of transactions ensures that either all operations within
a transaction are executed or none of them are?
a. Atomicity
b. Consistency
c. Isolation
d. Durability
Answer: a) Atomicity
13. What does the term “ACID” stand for in the context of database transactions?
a. Atomicity, Consistency, Isolation, Durability
b. All Conditions in Database
c. Advanced Control for Integrated Databases
d. Atomic, Consistent, Isolated, Durable
Answer: a) Atomicity, Consistency, Isolation, Durability
14. Which operation of a transaction ensures that changes made during the transaction are
permanently saved?
a. Read
b. Write
c. Commit
d. Rollback
e. None
Answer: c) Commit
15. What is the purpose of the “rollback” operation in a transaction?
a. To undo changes made during the transaction
b. To finalize the transaction
c. To retrieve data from the database
d. To lock the database
Answer: a) To undo changes made during the transaction
16. Which property of transactions ensures that the database remains in a consistent state
before and after the transaction?
a. Consistency
b. Isolation
c. Atomicity
d. Durability
Answer: a) Consistency
17. What is the purpose of the “isolation” property in transactions?
a. To prevent concurrent access to the same data
b. To ensure data durability
c. To optimize query performance
d. To create new database tables
Answer: a) To prevent concurrent access to the same data
18. Which of the following operations is used to permanently save the work done in a
transaction?
a. Read
b. Write
c. Commit
d. Rollback
Answer: c) Commit
19. What is the purpose of the “durability” property in transactions?
a. To ensure that changes made during the transaction are permanent
b. To prevent unauthorized access to the database
c. To optimize query execution
d. To create backup copies of the database
Answer: a) To ensure that changes made during the transaction are permanent
20. Which of the following is not a property of transactions?
a. Atomicity
b. Consistency
c. Isolation
d. Redundancy
Answer: d) Redundancy
21. Incremental logging with deferred updates implies that the recovery system must
a. store the old value of the updated item in the log
b. store the new value of the updated item in the log
c. store both the old and new value of the updated item in the log
d. store only the Begin Transaction and Commit Transaction records in the log
Answer b store the new value of the updated item in the log
22. The write-ahead logging (WAL) protocol simply means that
a. writing of a data item should be done ahead of any logging operation
b. the log record for an operation should be written before the actual data is written
c. all log records should be written before a new transaction begins execution
d. the log never needs to be written to disk
Answer b: the log record for an operation should be written before the actual data is written

23. In case of transaction failure under a deferred update incremental logging scheme, which
of the following will be needed?
a. an undo operation
b. a redo operation
c. an undo and redo operation
d. none of the above
Answer: an undo and redo operation
24. For incremental logging with immediate updates, a log record for a transaction would
contain
a. a transaction name, a data item name, and the old and new value of the item
b. a transaction name, a data item name, and the old value of the item
c. a transaction name, a data item name, and the new value of the item
d. a transaction name and a data item name
Answer: a transaction name, a data item name, and the old and new value of the item
25. For correct behavior during recovery, undo and redo operations must be
a. Commutative
b. Associative
c. Idempotent
d. distributive
Answer c Idempotent
26. When a failure occurs, the log is consulted and each operation is either undone or redone.
This is a problem because
a. searching the entire log is time consuming
b. many redos are unnecessary
c. both (a) and (b)
d. none of the above
Answer: both (a) and (b)
27. Using a log-based recovery scheme might improve performance as well as provide a
recovery mechanism by
a. writing the log records to disk when each transaction commits
b. writing the appropriate log records to disk during the transaction’s execution
c. waiting to write the log records until multiple transactions commit and writing them
as a batch
d. never writing the log records to disk
Answer c: waiting to write the log records until multiple transactions commit and writing them
as a batch
28. There is a possibility of a cascading rollback when
a. a transaction writes items that have been written only by a committed transaction
b. a transaction writes an item that is previously written by an uncommitted transaction
c. a transaction reads an item that is previously written by an uncommitted transaction
d. both b and c
Answer; d both b and c
29. To cope with media (disk) failures, it is necessary
a. for the DBMS to only execute transactions in a single user environment
b. to keep a redundant copy of the database
c. to never abort a transaction
d. all of the above
Answer b: to keep a redundant copy of the database
30. If the shadowing approach is used for flushing a data item back to disk, then
a. the item is written to disk only after the transaction commits
b. the item is written to a different location on disk
c. the item is written to disk before the transaction commits
d. the item is written to the same disk location from which it was read
Answer: b the item is written to a different location on disk
31. Which of the following best describes database query processing?
a. The process of retrieving and manipulating data from a database
b. The process of designing a database schema
c. The process of securing a database against cyber threats
d. The process of backing up a database regularly
e. None
Answer: A) The process of retrieving and manipulating data from a database
32. What is the main goal of query optimization in database systems?
a. To maximize the size of the database
b. To minimize the number of users accessing the database
c. To minimize the cost of executing a query
d. To increase the complexity of database queries
Answer: C) To minimize the cost of executing a query
33. Which of the following is NOT a step in database query processing?
a. Query parsing
b. Query execution
c. Database design
d. Query optimization
Answer: C) Database design
34. What is the purpose of indexing in database query processing?
a. To slow down data retrieval
b. To organize data for faster search and retrieval
c. To increase the size of the database
d. To encrypt sensitive data
Answer: B) To organize data for faster search and retrieval
35. Which of the following is an example of a database query optimization technique?
a. Data replication
b. Denormalization
c. Indexing
d. Data encryption
Answer: C) Indexing
36. What does the term "query parsing" refer to in database query processing?
a. Converting a query into an executable plan
b. Executing the query on the database
c. Interpreting the query language syntax
d. Storing the query result in memory
Answer: C) Interpreting the query language syntax
37. How can query optimization contribute to improved system performance?
a. By increasing the complexity of queries
b. By reducing the time and resources required to execute queries
c. By adding more indexes to the database
d. By increasing the number of tables in the database
Answer: B) By reducing the time and resources required to execute queries
38. Which of the following is NOT a common database query optimization strategy?
a. Join reordering
b. Subquery elimination
c. Full table scan
d. Predicate pushdown
Answer: C) Full table scan
39. What is the role of query optimization in enhancing data retrieval efficiency?
a. To slow down data retrieval for security purposes
b. To maximize data redundancy
c. To minimize unnecessary data access and processing
d. To increase network latency
Answer: C) To minimize unnecessary data access and processing
40. Why is understanding database query processing and optimization important for
students?
a. To increase job opportunities in cybersecurity
b. To enhance data security through encryption techniques
c. To improve system performance and efficiency
d. To develop advanced programming skills
Answer: C) To improve system performance and efficiency
41. A heterogeneous distributed database is which of the following?
a. The same DBMS is used at each location and data are not distributed across all nodes.
b. The same DBMS is used at each location and data are distributed across all nodes.
c. A different DBMS is used at each location and data are distributed across all nodes.
d. A different DBMS is used at each location and data are not distributed across all
nodes.
e. None
Answer c
42. One of the following is the cause of data integrity problem
a. Unauthorized disclosure
b. Unauthorized change
c. Unanticipated disclosure
d. A and c
e. None
Answer b
43. Which of the following is NOT a common database security threat?
a. SQL injection
b. Denial of Service (DoS) attacks
c. Data leakage prevention
d. Insider threats
Answer: C
44. What is the primary goal of database encryption in terms of security?
a. To prevent unauthorized access to sensitive data
b. To increase the speed of data retrieval
c. To reduce the size of the database
d. To enhance data redundancy
Answer: A) To prevent unauthorized access to sensitive data
45. Which of the following is a best practice for securing a database against SQL injection
attacks?
a. Using weak passwords for database accounts
b. Sanitizing user input before executing queries
c. Storing sensitive data in plain text format
d. Disabling all security features for faster query processing
Answer: B) Sanitizing user input before executing queries
46. What role does access control play in database security?
a. It ensures that all data is stored in plaintext format
b. It restricts unauthorized users from accessing sensitive data
c. It increases the complexity of database queries
d. It eliminates the need for user authentication
Answer: B) It restricts unauthorized users from accessing sensitive data
47. What is the purpose of implementing database auditing in a secure environment?
a. To slow down data retrieval for security purposes
b. To track and monitor user activities and changes made to the database
c. To increase the size of the database
d. To improve system performance and efficiency
Answer: B) To track and monitor user activities and changes made to the database
48. Which of the following is NOT a common authentication method used in database
security?
a. Single Sign-On (SSO)
b. Multi-Factor Authentication (MFA)
c. Passwordless authentication
d. Public key encryption
Answer: D) Public key encryption
49. What is the significance of role-based access control (RBAC) in database security?
a. It allows all users to have full access to all data in the database
b. It restricts users based on their roles and responsibilities within an organization
c. It increases the risk of insider threats
d. It slows down query processing#
Answer: B) It restricts users based on their roles and responsibilities within an organization
50. How can regular database backups contribute to enhancing database security?
a. By increasing the risk of data loss in case of a security breach
b. B) By reducing the need for data encryption
c. C) By providing a way to restore data in case of a security incident
d. D) By increasing the complexity of database queries
Answer: C) By providing a way to restore data in case of a security incident
51. What role does patch management play in maintaining a secure database environment?
a. It increases the risk of cyber threats
b. It ensures that all software vulnerabilities are left unaddressed
c. It involves regularly updating and applying security patches to prevent exploitation of
known vulnerabilities
d. It eliminates the need for user authentication
Answer: C) It involves regularly updating and applying security patches to prevent exploitation
of known vulnerabilities
52. Which of the following is not a minimum condition for a database to be called
distributed?
a. Connection of database nodes over a computer network.
b. Logical interrelation of the connected databases.
c. Possible absence of homogeneity among connected nodes.
d. Physical proximity or geographical distribution.
e. None of the above.
Answer d
53. Which type of transparency in distributed database environment deal with copies of the
same data objects may be stored at multiple sites for better availability, performance, and
reliability.
a. Naming transparency
b. Location transparency
c. Fragmentation transparency
d. Data organization transparency
e. None
Answer e
54. ______________ autonomy refers to independence of data model usage and transaction
management techniques among nodes in distributed database environment.
a. Execution
b. Communication
c. Design
d. Load
e. None

You might also like