0% found this document useful (0 votes)
116 views

Advanced DB Questions and Answer

database

Uploaded by

Mike Gudeta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views

Advanced DB Questions and Answer

database

Uploaded by

Mike Gudeta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 66

 Database security techniques and procedures

1. Which of the following is a common method to enforce database access control?

- A. Indexing

- B. SQL Injection

- C. Role-based access control (RBAC)

- D. Data replication

- Answer: C. Role-based access control (RBAC)

2. What is the primary purpose of database encryption?

- A. To improve query performance

- B. To prevent data loss during system crashes

- C. To protect sensitive data from unauthorized access

- D. To facilitate data replication

- Answer: C. To protect sensitive data from unauthorized access

3. Which of the following attacks specifically targets the database layer of an application?

- A. Cross-site scripting (XSS)

- B. SQL Injection

- C. Phishing

- D. Man-in-the-middle (MITM)

- Answer: B. SQL Injection

4. Which of the following is NOT a database security best practice?

- A. Regularly applying security patches

- B. Using default database passwords

- C. Implementing least privilege access

- D. Encrypting sensitive data

- Answer: B. Using default database passwords

5. What is the role of a database firewall?


- A. To monitor and block malicious SQL traffic

- B. To backup database data regularly

- C. To provide high availability for database systems

- D. To compress database files

- Answer: A. To monitor and block malicious SQL traffic

6. Which of the following techniques can help prevent SQL injection attacks?

- A. Using prepared statements

- B. Disabling database encryption

- C. Using extensive database indexing

- D. Allowing all users full database access

- Answer: A. Using prepared statements

7. What is the main purpose of database auditing?

- A. To optimize query performance

- B. To monitor and log database activities for security and compliance

- C. To enforce referential integrity

- D. To enable data sharding

- Answer: B. To monitor and log database activities for security and compliance

8. Which of the following describes the principle of least privilege?

- A. Users are given the minimum levels of access – or permissions – needed to perform their job
functions

- B. All users have full access to all database functionalities

- C. Privileged users have unrestricted access to database systems

- D. Database administrators have read-only access to all data

- Answer: A. Users are given the minimum levels of access – or permissions – needed to perform their
job functions

9. Which security feature ensures that data remains unchanged during transmission between the client and
the server?

- A. Data integrity
- B. Data masking

- C. Encryption

- D. Authentication

- Answer: C. Encryption

10. In database security, what is a "honeypot"?

- A. A highly secure database instance

- B. A decoy database setup to detect and analyze unauthorized access

- C. A method for optimizing database queries

- D. A type of database backup

- Answer: B. A decoy database setup to detect and analyze unauthorized access

11. Which database feature allows tracking of user actions and changes to data over time?

- A. Data mirroring

- B. Database auditing

- C. Data compression

- D. Data partitioning

- Answer: B. Database auditing

12. Which of the following methods helps ensure data confidentiality?

- A. Data normalization

- B. Data encryption

- C. Data indexing

- D. Data replication

- Answer: B. Data encryption

13. What does the term "SQL injection" refer to?

- A. A method to optimize SQL queries

- B. An attack that allows execution of arbitrary SQL code on the database

- C. A technique to enforce foreign key constraints


- D. A way to perform data partitioning

- Answer: B. An attack that allows execution of arbitrary SQL code on the database

14. Which type of attack exploits vulnerabilities in the way input is handled in database applications?

- A. SQL Injection

- B. Denial of Service (DoS)

- C. Buffer Overflow

- D. Cross-Site Request Forgery (CSRF)

- Answer: A. SQL Injection

15. What is the primary function of database masking?

- A. To encrypt all data in the database

- B. To hide sensitive information by obfuscating data

- C. To improve database query performance

- D. To replicate data across multiple databases

- Answer: B. To hide sensitive information by obfuscating data

16. What is "database hardening"?

- A. Increasing the physical security of database servers

- B. Applying techniques and measures to reduce the attack surface of the database system

- C. Encrypting all data stored in the database

- D. Backing up database data regularly

- Answer: B. Applying techniques and measures to reduce the attack surface of the database system

17. Which of the following is a key benefit of implementing role-based access control (RBAC) in a
database?

- A. Improved query performance

- B. Simplified user permissions management

- C. Automatic data replication

- D. Enhanced data compression

- Answer: B. Simplified user permissions management


18. Which method can be used to detect unauthorized changes to database data?

- A. Data replication

- B. Data auditing

- C. Data partitioning

- D. Data indexing

- Answer: B. Data auditing

19. What does "CIA" stand for in the context of database security?

- A. Confidentiality, Integrity, Availability

- B. Consistency, Isolation, Atomicity

- C. Compression, Indexing, Archiving

- D. Checkpoints, Indexes, Authentication

- Answer: A. Confidentiality, Integrity, Availability

20. Which of the following mechanisms helps ensure that database users can only access the data they are
authorized to view?

- A. SQL Injection

- B. Data Encryption

- C. Access Control Lists (ACLs)

- D. Data Compression

- Answer: C. Access Control Lists (ACLs)

21. Which of the following tools is commonly used for vulnerability scanning in databases?

- A. Wireshark

- B. Nessus

- C. JMeter

- D. Splunk

- Answer: B. Nessus

22. What is the purpose of database tokenization?

- A. To segment large databases into smaller parts


- B. To replace sensitive data with unique identification symbols that retain essential information
without compromising security

- C. To encrypt entire database files

- D. To improve database indexing

- Answer: B. To replace sensitive data with unique identification symbols that retain essential
information without compromising security

23. Which database security measure involves checking user credentials against an external authentication
provider like LDAP or Active Directory?

- A. Data masking

- B. Federated authentication

- C. Tokenization

- D. SSL/TLS encryption

- Answer: B. Federated authentication

24. What is an advantage of using database triggers for security purposes?

- A. They improve database performance

- B. They automate the enforcement of security policies at the database level

- C. They reduce the need for data normalization

- D. They enhance the efficiency of database backups

- Answer: B. They automate the enforcement of security policies at the database level

25. Which technique ensures that no unauthorized users can access the database, even if they gain
network access?

- A. Data encryption

- B. Firewalls

- C. Virtual Private Network (VPN)

- D. Authentication and authorization mechanisms

- Answer: D. Authentication and authorization mechanisms

26. What is the main objective of database integrity constraints?

- A. To ensure that only authorized users can access the database


- B. To maintain the accuracy and consistency of data within a database

- C. To encrypt sensitive data

- D. To partition large databases into manageable segments

- Answer: B. To maintain the accuracy and consistency of data within a database

27. In the context of database security, what is the function of a database administrator (DBA)?

- A. To develop application software

- B. To configure and maintain the database environment to ensure its security, availability, and
performance

- C. To perform regular data entry tasks

- D. To manage network security

- Answer: B. To configure and maintain the database environment to ensure its security, availability,
and performance

28. Which of the following practices helps in ensuring data integrity?

- A. Implementing referential constraints

- B. Allowing unrestricted access to database users

- C. Using default credentials

- D. Regularly deleting old data

- Answer: A. Implementing referential constraints

29. What type of database attack involves unauthorized access by exploiting vulnerabilities in stored
procedures or database functions?

- A. Cross-site scripting (XSS)

- B. Privilege escalation

- C. SQL Injection

- D. Denial of Service (DoS)

- Answer: C. SQL Injection

30. Which protocol is typically used to secure data transmission between clients and database servers?

- A. HTTP

- B. FTP
- C. SSL/TLS

- D. SMTP

- Answer: C. SSL/TLS

31. Which of the following is a proactive measure to detect security breaches in databases?

- A. Data masking

- B. Regular auditing and monitoring

- C. Data encryption

- D. Using default settings

- Answer: B. Regular auditing and monitoring

32. Which of the following describes "database sharding" as a security measure?

- A. Encrypting the database to protect data at rest

- B. Distributing a single database across multiple servers to enhance performance and security

- C. Backing up the database to a secure location

- D. Monitoring database activity for suspicious behavior

- Answer: B. Distributing a single database across multiple servers to enhance performance and
security

33. Which feature allows database administrators to specify security policies for data access at a more
granular level, such as specific rows or columns?

- A. Column-level encryption

- B. Row-level security (RLS)

- C. Full-disk encryption

- D. Database indexing

- Answer: B. Row-level security (RLS)

34. Which of the following is an example of a discretionary access control (DAC) model in databases?

- A. Access control based on user roles

- B. Access control based on security labels

- C. Access control based on the discretion of the data owner


- D. Access control based on predefined policies

- Answer: C. Access control based on the discretion of the data owner

35. What is the purpose of implementing database obfuscation techniques?

- A. To enhance query performance

- B. To hide the actual data from unauthorized users while maintaining its usability

- C. To simplify database design

- D. To reduce storage requirements

- Answer: B. To hide the actual data from unauthorized users while maintaining its usability

36. Which security measure can prevent unauthorized users from performing administrative actions on
the database?

- A. Using database firewalls

- B. Implementing least privilege principles

- C. Encrypting database backups

- D. Applying data compression techniques

- Answer: B. Implementing least privilege principles

37. What is a potential risk of not regularly applying security patches to database systems?

- A. Improved database performance

- B. Enhanced user access

- C. Increased vulnerability to security breaches

- D. Reduced data storage costs

- Answer: C. Increased vulnerability to security breaches

38. Which security technique involves regularly testing database systems to identify potential
vulnerabilities?

- A. Data encryption

- B. Penetration testing

- C. Database sharding

- D. Data normalization
- Answer: B. Penetration testing

39. What does the term "data at rest" refer to in database security?

- A. Data being transmitted over a network

- B. Data being actively processed

- C. Data stored in persistent storage

- D. Data awaiting deletion

- Answer: C. Data stored in persistent storage

40. Which of the following can be used to enforce data confidentiality, integrity, and availability in a
database system?

- A. CIA triad

- B. Indexing

- C. Data replication

- D. SQL queries

- Answer: A. CIA triad

No One:

41. Which procedure involves reviewing database access logs to identify unauthorized access attempts?

- A. Data normalization

- B. Access log auditing

- C. Index rebuilding

- D. Data partitioning

- Answer: B. Access log auditing

42. Which procedure should be implemented to ensure that only authorized users can view certain
sensitive information in a database?

- A. Data encryption

- B. Role-based access control (RBAC)

- C. Data compression

- D. Indexing
- Answer: B. Role-based access control (RBAC)

43. What is the main purpose of conducting a database security assessment?

- A. To improve database performance

- B. To identify and mitigate potential security vulnerabilities

- C. To enhance data replication processes

- D. To increase storage capacity

- Answer: B. To identify and mitigate potential security vulnerabilities

44. Which procedure ensures that sensitive data is not displayed to unauthorized users, even if they have
access to the database?

- A. Data masking

- B. Data compression

- C. Data partitioning

- D. Indexing

- Answer: A. Data masking

45. Which procedure involves dividing database access privileges among multiple users to minimize the
risk of insider threats?

- A. Role separation

- B. Data sharding

- C. Data archiving

- D. Query optimization

- Answer: A. Role separation

46. Which procedure involves the use of database views to restrict user access to specific subsets of data?

- A. Data replication

- B. View-based access control

- C. Data encryption

- D. Data normalization

- Answer: B. View-based access control


47. What is the purpose of setting up database triggers for security purposes?

- A. To enhance query performance

- B. To automatically enforce security policies and monitor suspicious activities

- C. To increase storage efficiency

- D. To facilitate data replication

- Answer: B. To automatically enforce security policies and monitor suspicious activities

48. Which procedure is used to ensure that database backups are secure from unauthorized access?

- A. Encrypting database backups

- B. Data compression

- C. Indexing

- D. Normalization

- Answer: A. Encrypting database backups

49. Which procedure is essential for recovering a database after a security breach or data corruption
event?

- A. Regular data backups

- B. Data partitioning

- C. Data sharding

- D. Index rebuilding

- Answer: A. Regular data backups

50. Which procedure helps ensure that all database transactions are logged for future review and
compliance purposes?

- A. Database auditing

- B. Data encryption

- C. Index optimization

- D. Data normalization

- Answer: A. Database auditing

51. Which procedure involves limiting the use of administrative accounts to reduce the risk of misuse?
- A. Least privilege principle

- B. Role separation

- C. Data encryption

- D. Data normalization

- Answer: A. Least privilege principle

52. What is the purpose of using multi-factor authentication (MFA) in database security?

- A. To optimize database queries

- B. To provide an additional layer of security by requiring multiple forms of verification for user
access

- C. To enhance data compression

- D. To facilitate data replication

- Answer: B. To provide an additional layer of security by requiring multiple forms of verification for
user access

53. Which procedure helps protect against SQL injection attacks by validating user inputs and limiting
SQL execution capabilities?

- A. Input sanitization

- B. Data sharing

- C. Data compression

- D. Query optimization

- Answer: A. Input sanitization

54. Which procedure involves using hashing algorithms to store passwords securely in a database?

- A. Password hashing

- B. Data encryption

- C. Data compression

- D. Data partitioning

- Answer: A. Password hashing

55. Which procedure ensures that database administrators are notified of suspicious activities in real-
time?
- A. Real-time monitoring and alerting

- B. Data replication

- C. Data compression

- D. Indexing

- Answer: A. Real-time monitoring and alerting

56. Which procedure involves regularly updating database software to protect against known
vulnerabilities?

- A. Applying security patches

- B. Data normalization

- C. Data archiving

- D. Index optimization

- Answer: A. Applying security patches

57. Which procedure is used to verify that data modifications adhere to defined security policies before
they are committed to the database?

- A. Data validation

- B. Data encryption

- C. Data normalization

- D. Data sharding

- Answer: A. Data validation

58. Which procedure involves the regular review of user access permissions to ensure they are
appropriate for their roles?

- A. Access control review

- B. Data encryption

- C. Data partitioning

- D. Data compression

- Answer: A. Access control review

59. Which procedure is used to ensure the authenticity and integrity of data transmitted over a network?

- A. Data encryption
- B. Data masking

- C. Data compression

- D. Data normalization

- Answer: A. Data encryption

60. Which procedure involves simulating cyber-attacks to evaluate the effectiveness of database security
measures?

- A. Penetration testing

- B. Data sharding

- C. Data partitioning

- D. Query optimization

- Answer: A. Penetration testing

 Database query processing and optimization


1. Which of the following is the main goal of query optimization in databases?

- A. To minimize the number of queries

- B. To minimize the response time of queries

- C. To maximize data redundancy

- D. To maximize the number of joins in a query

- Answer: B. To minimize the response time of queries

2. Which of the following techniques can be used to improve the performance of a query that involves
joining large tables?

- A. Indexing

- B. Data encryption

- C. Data normalization

- D. Data compression

- Answer: A. Indexing

3. In query optimization, what does the term "cost-based optimization" refer to?

- A. Selecting the query execution plan with the lowest estimated cost
- B. Choosing queries that require the least amount of coding

- C. Using the most expensive hardware available

- D. Prioritizing queries with the highest cost

- Answer: A. Selecting the query execution plan with the lowest estimated cost

4. which of the following is a strategy used by query optimizers to evaluate and choose the best query
execution plan?

- A. Heuristic optimization

- B. Random sampling

- C. Full-table scans

- D. Query rewriting

- Answer: A. Heuristic optimization

5. What is the purpose of using a query execution plan in a database management system (DBMS)?

- A. To outline the steps required to execute a query

- B. To encrypt the query data

- C. To normalize the query results

- D. To replicate the query across multiple databases

- Answer: A. To outline the steps required to execute a query

6. Which of the following SQL clauses can significantly impact query performance due to its ability to
limit the number of rows returned by a query?

- A. GROUP BY

- B. WHERE

- C. ORDER BY

- D. LIMIT

- Answer: D. LIMIT

7. What is the effect of using an index on a column that is frequently used in search conditions (e.g.,
WHERE clause) of queries?

- A. It increases the size of the database

- B. It decreases the query execution time


- C. It normalizes the data

- D. It fragments the database

- Answer: B. It decreases the query execution time

8. Which type of join is generally the most performance-intensive due to its need to compare each row of
two tables?

- A. INNER JOIN

- B. OUTER JOIN

- C. CROSS JOIN

- D. LEFT JOIN

- Answer: C. CROSS JOIN

9. What is the purpose of query rewriting in the context of query optimization?

- A. To translate queries into a different language

- B. To transform queries into an equivalent form that is expected to execute more efficiently

- C. To encrypt the query results

- D. To replicate the query to multiple databases

- Answer: B. To transform queries into an equivalent form that is expected to execute more efficiently

10. Which of the following is NOT a common method for optimizing SQL queries?

- A. Using subqueries instead of joins

- B. Creating indexes on frequently queried columns

- C. Avoiding the use of SELECT *

- D. Breaking complex queries into simpler ones

- Answer: A. Using subqueries instead of joins

11. Which technique helps in reducing the size of data that needs to be scanned during query execution?

- A. Indexing

- B. Data encryption

- C. Data normalization

- D. Data partitioning
- Answer: A. Indexing

12. What is the primary benefit of using a clustered index in a database?

- A. It allows for faster retrieval of data by maintaining data in a sorted order

- B. It increases data redundancy

- C. It compresses the database

- D. It encrypts the data

- Answer: A. It allows for faster retrieval of data by maintaining data in a sorted order

13. Which of the following is an advantage of using query hints in SQL queries?

- A. It allows the query optimizer to ignore index usage

- B. It provides specific instructions to the query optimizer on how to execute the query

- C. It normalizes the data automatically

- D. It compresses the query results

- Answer: B. It provides specific instructions to the query optimizer on how to execute the query

14. Which aspect of a database system does the "SELECTIVITY" of an index refer to?

- A. The fraction of data rows accessed by the index

- B. The number of unique values in the indexed column

- C. The physical storage of the index

- D. The query execution time improvement

- Answer: A. The fraction of data rows accessed by the index

15. What is the purpose of using materialized views in a database?

- A. To store a precomputed result set that can be queried to improve performance

- B. To normalize the data

- C. To encrypt sensitive data

- D. To partition large tables

- Answer: A. To store a precomputed result set that can be queried to improve performance
16. Which database feature allows for the efficient execution of repetitive queries by caching their
execution plans?

- A. Query cache

- B. Data compression

- C. Index rebuilding

- D. Data sharding

- Answer: A. Query cache

17. In query optimization, what does "pipelining" refer to?

- A. Executing multiple queries in parallel

- B. Passing intermediate results of one operation directly to the next operation without intermediate
storage

- C. Storing the final query results in a temporary table

- D. Encrypting data during query execution

- Answer: B. Passing intermediate results of one operation directly to the next operation without
intermediate storage

18. What is the benefit of using partitioned tables in query processing?

- A. They improve data compression

- B. They help in managing large datasets by dividing them into smaller, more manageable pieces

- C. They normalize the database

- D. They encrypt sensitive data

- Answer: B. They help in managing large datasets by dividing them into smaller, more manageable
pieces

19. Which of the following is a downside of over-indexing a database?

- A. It reduces data redundancy

- B. It increases the complexity of query execution plans

- C. It can slow down data modification operations such as INSERT, UPDATE, and DELETE

- D. It normalizes the database excessively

- Answer: C. It can slow down data modification operations such as INSERT, UPDATE, and DELETE
20. What is an "execution plan" in the context of query processing?

- A. A strategy for database backup

- B. A detailed outline of the steps the DBMS will take to execute a query

- C. A method for normalizing the database

- D. A technique for encrypting query results

- Answer: B. A detailed outline of the steps the DBMS will take to execute a query

21. Which join algorithm is generally considered efficient for joining small tables?

- A. Nested loop join

- B. Merge join

- C. Hash join

- D. Cartesian join

- Answer: A. Nested loop join

22. What is the role of a database query optimizer?

- A. To encrypt database queries

- B. To determine the most efficient way to execute a query

- C. To normalize database schemas

- D. To compress query results

- Answer: B. To determine the most efficient way to execute a query

23. Which technique helps in improving the performance of aggregate queries that involve large datasets?

- A. Using summary tables

- B. Encrypting the data

- C. Data normalization

- D. Query partitioning

- Answer: A. Using summary tables

24. Which of the following can be used to ensure that queries are executed with a consistent performance
despite changes in the database?

- A. Query plan stability


- B. Data encryption

- C. Index rebuilding

- D. Data sharding

- Answer: A. Query plan stability

25. Which type of index is designed to improve the performance of queries that filter rows based on a
range of values?

- A. Full-text index

- B. Bitmap index

- C. B-tree index

- D. Hash index

- Answer: C. B-tree index

26. What is the purpose of a query optimizer's cost model?

- A. To estimate the resources required to execute a query plan

- B. To encrypt the query execution plan

- C. To normalize query results

- D. To partition the database

26. What is the purpose of a query optimizer's cost model?

- A. To estimate the resources required to execute a query plan

- B. To encrypt the query execution plan

- C. To normalize query results

- D. To partition the database

- Answer: A. To estimate the resources required to execute a query plan

27. Which of the following strategies is used by query optimizers to generate alternative execution plans?

- A. Random execution

- B. Execution plan enumeration

- C. Query sampling

- D. Direct interpretation
- Answer: B. Execution plan enumeration

28. In which scenario is a hash join typically more efficient than a nested loop join?

- A. When joining two small tables

- B. When joining tables with large datasets and no indexes

- C. When performing self-joins

- D. When joining tables with composite keys

- Answer: B. When joining tables with large datasets and no indexes

29. Which SQL clause can be optimized by creating an index on the column specified in the clause?

- A. FROM

- B. HAVING

- C. GROUP BY

- D. WHERE

- Answer: D. WHERE

30. Which of the following describes "query optimization techniques" in a relational database?

- A. Methods used to translate high-level queries into low-level operations

- B. Techniques to physically organize data on disk

- C. Methods to automatically encrypt query results

- D. Techniques used to improve query performance and efficiency

- Answer: D. Techniques used to improve query performance and efficiency

31. What does the term "cardinality" refer to in the context of query processing?

- A. The number of columns in a table

- B. The uniqueness of data values contained in a particular column (number of distinct values)

- C. The primary key constraints

- D. The foreign key relationships

- Answer: B. The uniqueness of data values contained in a particular column (number of distinct
values)

32. Which query processing strategy is used to avoid performing full-table scans?
- A. Using indexes

- B. Query normalization

- C. Query encryption

- D. Data partitioning

- Answer: A. Using indexes

33. What is the main advantage of using a materialized view over a regular view in query processing?

- A. Materialized views store precomputed data, improving query performance

- B. Materialized views automatically encrypt the data

- C. Materialized views provide real-time data updates

- D. Materialized views reduce data redundancy

- Answer: A. Materialized views store precomputed data, improving query performance

34. Which technique is used by databases to improve the performance of queries that frequently access
the same set of data?

- A. Query caching

- B. Data sharding

- C. Data normalization

- D. Query encryption

- Answer: A. Query caching

35. Which of the following operations can be optimized by indexing the relevant columns in a database?

- A. Aggregate functions

- B. JOIN operations

- C. Data normalization

- D. Data encryption

- Answer: B. JOIN operations

36. What is the primary goal of the query planner in a relational database management system (RDBMS)?

- A. To plan the layout of data on disk

- B. To generate efficient execution plans for queries


- C. To encrypt database tables

- D. To compress database files

- Answer: B. To generate efficient execution plans for queries

37. Which query optimization technique involves rewriting queries to use more efficient constructs?

- A. Logical optimization

- B. Physical optimization

- C. Data encryption

- D. Data normalization

- Answer: A. Logical optimization

38. What is the purpose of using "hints" in SQL queries?

- A. To provide the query optimizer with additional information to improve query performance

- B. To automatically normalize the database schema

- C. To encrypt the query results

- D. To increase the storage capacity of the database

- Answer: A. To provide the query optimizer with additional information to improve query
performance

39. Which of the following describes the "cost" in cost-based query optimization?

- A. The monetary cost of running a query

- B. The estimated computational resources required to execute a query

- C. The time taken to write a query

- D. The data redundancy level in a database

- Answer: B. The estimated computational resources required to execute a query

40. What is the role of a "query execution plan"?

- A. To outline the steps a database management system will take to execute a query

- B. To encrypt the query data

- C. To normalize query results

- D. To partition database tables


- Answer: A. To outline the steps a database management system will take to execute a query

41. Which of the following can be a consequence of not properly optimizing SQL queries?

- A. Increased query response time

- B. Reduced data redundancy

- C. Increased data normalization

- D. Improved data security

- Answer: A. Increased query response time

42. What is the benefit of using indexes on foreign key columns?

- A. It speeds up join operations involving those columns

- B. It increases data redundancy

- C. It compresses the database size

- D. It automatically encrypts the data

- Answer: A. It speeds up join operations involving those columns

43. Which of the following is an example of a heuristic used in query optimization?

- A. Always using nested loop joins

- B. Pushing selections as close to the base tables as possible

- C. Avoiding the use of indexes

- D. Always using full-table scans

- Answer: B. Pushing selections as close to the base tables as possible

44. What is the primary advantage of using in-memory databases for query processing?

- A. Faster query execution due to data being stored in RAM

- B. Reduced data redundancy

- C. Automatic data encryption

- D. Improved data normalization

- Answer: A. Faster query execution due to data being stored in RAM

45. Which query processing operation benefits the most from the use of bitmap indexes?
- A. Range queries

- B. Equality queries on low-cardinality columns

- C. String matching queries

- D. Aggregate functions

- Answer: B. Equality queries on low-cardinality columns

46. Which join operation combines rows from two tables based on a related column and returns rows that
do not have matching values in both tables?

- A. INNER JOIN

- B. LEFT JOIN

- C. RIGHT JOIN

- D. FULL OUTER JOIN

- Answer: D. FULL OUTER JOIN

47. What does the term "predicate pushdown" refer to in query optimization?

- A. Pushing the filtering conditions down the query execution plan as close to the data source as
possible

- B. Pushing data from memory to disk

- C. Aggregating data early in the query execution

- D. Delaying joins until the final step

- Answer: A. Pushing the filtering conditions down the query execution plan as close to the data source
as possible

48. Which of the following can be used to measure the performance of a query execution plan?

- A. Execution time

- B. Data normalization level

- C. Encryption strength

- D. Storage capacity

- Answer: A. Execution time

49. In the context of databases, what is a "join condition"?

- A. A condition that specifies how two tables should be combined


- B. A condition that encrypts the result set

- C. A condition that normalizes the data

- D. A condition that compresses the query results

- Answer: A. A condition that specifies how two tables should be combined

50. Which of the following is a characteristic of a good query execution plan?

- A. It minimizes the use of temporary tables

- B. It maximizes the number of full-table scans

- C. It uses the least number of joins

- D. It always performs nested loop joins

- Answer: A. It minimizes the use of temporary tables

1. Given the following SQL query, which index would improve the performance of the query the most?

SELECT * FROM Employees WHERE LastName = 'Smith';

- A. Index on FirstName

- B. Index on LastName

- C. Index on EmployeeID

- D. Index on Salary

- Answer: B. Index on LastName

2. Consider the following query:

SELECT CustomerID, COUNT(OrderID)

FROM Orders

GROUP BY CustomerID

HAVING COUNT(OrderID) > 5;

Which optimization technique can be used to improve the performance of this query?

- A. Creating an index on OrderID

- B. Creating an index on CustomerID


- C. Normalizing the Orders table

- D. Using a subquery instead of a HAVING clause

- Answer: B. Creating an index on CustomerID

3. Given the SQL query below, which optimization strategy is being employed?

SELECT * FROM Products WHERE Price BETWEEN 10 AND 50;

- A. Indexing

- B. Query caching

- C. Data encryption

- D. Sharding

- Answer: A. Indexing

4. Which of the following queries would benefit most from a composite index on (CategoryID, Price)?

- A. SELECT * FROM Products WHERE CategoryID = 1 AND Price > 100

- B. SELECT * FROM Products WHERE CategoryID = 1;

- C. SELECT * FROM Products WHERE Price > 100;

- D. SELECT * FROM Products WHERE ProductName LIKE 'A%';

Answer: A.SELECT * FROM Products WHERE CategoryID = 1 AND Price > 100;

5. For the following SQL query:

SELECT e.EmployeeID, d.DepartmentName

FROM Employees e

JOIN Departments d ON e.DepartmentID = d.DepartmentID;

What type of join is used and what is its purpose?

- A. INNER JOIN; to combine rows from both tables where there is a match on DepartmentID

- B. LEFT JOIN; to include all rows from Employees and matched rows from Departments

- C. RIGHT JOIN; to include all rows from Departments and matched rows from Employees

- D. FULL OUTER JOIN; to include all rows from both tables

- Answer: A. INNER JOIN; to combine rows from both tables where there is a match on DepartmentID
6. Which of the following indexes would be most beneficial for the given query?

SELECT OrderID, OrderDate FROM Orders WHERE CustomerID = 123;

- A. Index on OrderDate

- B. Index on OrderID

- C. Index on CustomerID

- D. Composite index on (OrderID, OrderDate)

- Answer: C. Index on CustomerID

7. Consider the query below. Which optimization technique can be applied to reduce its execution time?

SELECT ProductID, SUM(Quantity)

FROM OrderDetails

GROUP BY ProductID

ORDER BY SUM(Quantity) DESC;

- A. Creating an index on ProductID

- B. Creating an index on Quantity

- C. Using a subquery

- D. Creating a composite index on (ProductID, Quantity)

- Answer: A. Creating an index on ProductID

8. Given the query:

SELECT CustomerName

FROM Customers

WHERE CustomerID IN (SELECT CustomerID FROM Orders WHERE OrderDate > '2024-01-01');

What optimization strategy could improve its performance?

- A. Using a JOIN instead of a subquery

- B. Creating an index on CustomerName

- C. Adding a HAVING clause


- D. Using the DISTINCT keyword

- Answer: A. Using a JOIN instead of a subquery

Rewritten Query:

SELECT c.CustomerName

FROM Customers c

JOIN Orders o ON c.CustomerID = o.CustomerID

WHERE o.OrderDate > '2024-01-01';

9. Which query would benefit most from a covering index on (ProductID, OrderID, Quantity)?

- A.SELECT ProductID, OrderID FROM OrderDetails WHERE Quantity > 10

- B. SELECT ProductID FROM OrderDetails WHERE OrderID = 10248;

- C. SELECT OrderID, Quantity FROM OrderDetails WHERE ProductID = 77;

- D. SELECT Quantity FROM OrderDetails WHERE ProductID = 77 AND OrderID = 10248

- Answer: A. SELECT ProductID, OrderID FROM OrderDetails WHERE Quantity > 10;

10. Which of the following describes the benefit of using a hash join for the given query?

SELECT e.EmployeeID, d.DepartmentName

FROM Employees e

JOIN Departments d ON e.DepartmentID = d.DepartmentID;

- A. Hash joins are faster for joining large tables with no indexes

- B. Hash joins minimize disk I/O operations

- C. Hash joins avoid the need for data normalization

- D. Hash joins encrypt the query results

- Answer: A. Hash joins are faster for joining large tables with no indexes

11. For the query below, which index would improve the performance of the ORDER BY clause?

SELECT * FROM Sales ORDER BY SaleDate;

- A. Index on SaleID
- B. Index on ProductID

- C. Index on SaleDate

- D. Index on CustomerID

- Answer: C. Index on SaleDate

12. What does the following query optimization technique refer to?

SELECT * FROM Products WHERE Price < (SELECT AVG(Price) FROM Products);

- A. Subquery caching

- B. Indexing subqueries

- C. Query unnesting

- D. Data partitioning

- Answer: C. Query unnesting

Rewritten Query:

SELECT p1.*

FROM Products p1

JOIN (SELECT AVG(Price) AS AvgPrice FROM Products) p2

ON p1.Price < p2.AvgPrice;

13. Given the following query, which optimization technique could improve its execution time?

SELECT OrderID, ProductID FROM OrderDetails WHERE Quantity = (SELECT MAX(Quantity)


FROM OrderDetails);

- A. Creating an index on OrderID

- B. Creating an index on ProductID

- C. Using a window function

- D. Creating a composite index on (OrderID, ProductID)

- Answer: C. Using a window function

Rewritten Query:

SELECT OrderID, ProductID

FROM (
SELECT OrderID, ProductID, Quantity, MAX(Quantity) OVER () AS MaxQuantity

FROM OrderDetails

) AS SubQuery

WHERE Quantity = MaxQuantity;

14. Which of the following is an example of "predicate pushdown" in query optimization?

SELECT * FROM Orders WHERE OrderID IN (SELECT OrderID FROM OrderDetails WHERE
Quantity > 5);

- A. Moving the WHERE clause condition into the subquery

- B. Using JOIN instead of IN

- C. Creating an index on OrderID

- D. Creating an index on Quantity

- Answer: A. Moving the WHERE clause condition into the subquery

15. Consider the following SQL query:

SELECT ProductName, COUNT(*)

FROM Products

WHERE Price > 20

GROUP BY ProductName

HAVING COUNT(*) > 1;

Which index would improve the performance of this query?

- A. Index on ProductName

- B. Index on Price

- C. Composite index on (Price, ProductName)

- D. Index on COUNT(*)

- Answer: C. Composite index on (Price, ProductName)

18. Consider the following SQL query:

SELECT ProductID, SUM(Quantity)

FROM OrderDetails
GROUP BY ProductID

HAVING SUM(Quantity) > 100;

Which indexing strategy could improve the performance of this query?

- A. Index on ProductID

- B. Index on Quantity

- C. Composite index on (ProductID, Quantity)

- D. Index on SUM(Quantity)

- Answer: A. Index on ProductID

19. Given the following query, what type of join is being used and why?

SELECT e.EmployeeID, d.DepartmentName

FROM Employees e

LEFT JOIN Departments d ON e.DepartmentID = d.DepartmentID;

- A. INNER JOIN; to include only matching rows

- B. LEFT JOIN; to include all employees and their departments if available

- C. RIGHT JOIN; to include all departments and their employees if available

- D. FULL OUTER JOIN; to include all rows from both tables

- Answer: B. LEFT JOIN; to include all employees and their departments if available

21. For the query below, which optimization technique can be applied to reduce execution time?

SELECT OrderID, CustomerID

FROM Orders

WHERE OrderDate BETWEEN '2024-01-01' AND '2024-12-31';

- A. Creating an index on OrderID


- B. Creating an index on CustomerID

- C. Creating an index on OrderDate

- D. Creating a composite index on (OrderDate, CustomerID)

- Answer: C. Creating an index on OrderDate

22. What is the purpose of using a covering index in the following query?

SELECT OrderID, OrderDate FROM Orders WHERE CustomerID = 123;

- A. To cover all columns used in the query, minimizing the need to access the table

- B. To encrypt the query results

- C. To normalize the Orders table

- D. To aggregate query results

- Answer: A. To cover all columns used in the query, minimizing the need to access the table

23. Consider the query below. Which index would improve its performance the most?

SELECT * FROM Sales WHERE SaleDate > '2024-01-01';

- A. Index on SaleID

- B. Index on ProductID

- C. Index on SaleDate

- D. Index on CustomerID

- Answer: C. Index on SaleDate

25. What is the primary purpose of query caching in the following scenario?

SELECT * FROM Orders WHERE OrderStatus = 'Shipped';

- A. To store the result of the query to serve future requests faster

- B. To normalize the Orders table

- C. To encrypt the query results

- D. To aggregate the query results

- Answer: A. To store the result of the query to serve future requests faster

20. Given the query:


SELECT CustomerName

FROM Customers

WHERE EXISTS (SELECT 1 FROM Orders WHERE Customers.CustomerID = Orders.CustomerID);

What optimization strategy could improve its performance?

- A. Using a JOIN instead of EXISTS

- B. Creating an index on CustomerName

- C. Adding a HAVING clause

- D. Using the DISTINCT keyword

- Answer: A. Using a JOIN instead of EXISTS

Rewritten Query:

SELECT c.CustomerName

FROM Customers c

JOIN Orders o ON c.CustomerID = o.CustomerID; `

26. Given the following SQL query, which indexing strategy could improve its performance?

SELECT ProductID, SUM(Quantity)

FROM OrderDetails

GROUP BY ProductID

HAVING SUM(Quantity) > 100;

- A. Index on ProductID

- B. Index on Quantity

- C. Composite index on (ProductID, Quantity)

- D. Index on SUM(Quantity)

- Answer: A. Index on ProductID

33. What is the primary purpose of query caching in the following scenario?

SELECT * FROM Orders WHERE OrderStatus = 'Shipped';


- A. To store the result of the query to serve future requests faster

- B. To normalize the Orders table

- C. To encrypt the query results

- D. To aggregate the query results

- Answer: A. To store the result of the query to serve future requests faste

34. For the following SQL query, which optimization technique can be applied to improve performance?

SELECT CustomerID, COUNT(OrderID)

FROM Orders

GROUP BY CustomerID;

- A. Creating an index on CustomerID

- B. Creating an index on OrderID

- C. Using a subquery

- D. Using a HAVING clause

- Answer: A. Creating an index on CustomerID

 Database recovery methods in db failure

1. Which recovery method involves periodically writing the database changes to a physical log file,
allowing the system to replay these changes to restore the database to a consistent state in case of failure?

- A. Rollback

- B. Shadow Paging

- C. Checkpoints

- D. Write-ahead logging

- Answer: D. Write-ahead logging

2. In database recovery, what is the primary purpose of a checkpoint?

- A. To undo uncommitted transactions

- B. To synchronize the database buffers with the disk

- C. To perform a full backup of the database


- D. To recover from a system crash

- Answer: B. To synchronize the database buffers with the disk

3. Which recovery method involves maintaining a shadow copy of the entire database, allowing the
system to switch to this copy in case of failure?

- A. Rollback

- B. Shadow Paging

- C. Checkpoints

- D. Write-ahead logging

- Answer: B. Shadow Paging

4. In database recovery, what is the primary purpose of a transaction log?

- A. To maintain a history of all transactions executed on the database

- B. To store temporary data during transaction processing

- C. To store database metadata

- D. To track changes made to the database that can be used for recovery

- Answer: D. To track changes made to the database that can be used for recovery

5. Which recovery method involves reversing the changes made by incomplete transactions during
database failure?

- A. Rollback

- B. Shadow Paging

- C. Checkpoints

- D. Write-ahead logging

- Answer: A. Rollback

6. Which recovery method involves periodically saving the database state to stable storage, allowing the
system to restore the database to this consistent state in case of failure?

- A. Rollback

- B. Shadow Paging

- C. Checkpoints
- D. Write-ahead logging

- Answer: C. Checkpoints

7. What is a drawback of using shadow paging as a recovery method?

- A. High overhead for maintaining transaction logs

- B. Inability to handle concurrent transactions effectively

- C. Requires frequent synchronization with the disk

- D. Increased storage space requirements for maintaining shadow copies

- Answer: D. Increased storage space requirements for maintaining shadow copies

8. Which recovery method provides the highest level of durability and is commonly used in modern
database systems?

- A. Rollback

- B. Shadow Paging

- C. Checkpoints

- D. Write-ahead logging

- Answer: D. Write-ahead logging

9. In write-ahead logging, what is the order of operations during transaction processing?

- A. Write to the log, write to the database

- B. Write to the database, write to the log

- C. Write to the log, checkpoint, write to the database

- D. Write to the database, checkpoint, write to the log

- Answer: A. Write to the log, write to the database

10. Which recovery method provides the fastest recovery time but may result in increased overhead
during normal operation due to the need for frequent checkpoints?

- A. Rollback

- B. Shadow Paging

- C. Checkpoints
- D. Write-ahead logging

- Answer: C. Checkpoints

11. Which recovery method is characterized by creating a log record before modifying the database,
ensuring that the changes are recorded before the actual modification occurs?

- A. Shadow Paging

- B. Checkpoints

- C. Write-ahead logging

- D. Rollback

- Answer: C. Write-ahead logging

12. What is the primary advantage of using write-ahead logging (WAL) for database recovery?

- A. Reduced storage space requirements

- B. Faster recovery time

- C. Simplicity in implementation

- D. Better support for complex transaction semantics

- Answer: B. Faster recovery time

13. In the context of database recovery, what role does the redo phase play in write-ahead logging
(WAL)?

- A. It undoes the changes made by incomplete transactions

- B. It synchronizes the database buffers with the disk

- C. It re-applies committed transactions' changes to the database during recovery

- D. It tracks changes made to the database during normal operation

- Answer: C. It re-applies committed transactions' changes to the database during recovery

14. Which recovery method maintains multiple versions of data blocks, allowing transactions to reference
the appropriate version to ensure consistency and recover from failures?

- A. Shadow Paging

- B. Checkpoints

- C. Multiversion concurrency control (MVCC)


- D. Write-ahead logging

- Answer: C. Multiversion concurrency control (MVCC)

15. What is a key benefit of multiversion concurrency control (MVCC) in terms of database recovery?

- A. Reduced storage space requirements

- B. Improved transaction isolation levels

- C. Faster recovery time

- D. Simpler recovery procedures

- Answer: B. Improved transaction isolation levels

16. Which recovery method requires maintaining a separate copy of the entire database, resulting in high
storage overhead but providing instantaneous recovery from failures?

- A. Shadow Paging

- B. Checkpoints

- C. Write-ahead logging

- D. Database mirroring

- Answer: A. Shadow Paging

17. In the context of database recovery, what is the purpose of a rollback segment?

- A. To store backup copies of the database

- B. To store log records of committed transactions

- C. To track changes made to the database

- D. To temporarily store undo information for active transactions

- Answer: D. To temporarily store undo information for active transactions

18. Which recovery method involves periodically writing database changes to stable storage before
committing transactions, ensuring that the changes are durable in case of failure?

- A. Write-ahead logging

- B. Checkpoints

- C. Shadow Paging
- D. Rollback

- Answer: A. Write-ahead logging

19. In the context of database recovery, what is the primary purpose of the undo phase in write-ahead
logging (WAL)?

- A. To synchronize the database buffers with the disk

- B. To undo the changes made by incomplete transactions

- C. To re-apply committed transactions' changes to the database

- D. To track changes made to the database during normal operation

- Answer: B. To undo the changes made by incomplete transactions

20. Which recovery method is suitable for handling system crashes and requires minimal overhead during
normal database operation?

- A. Write-ahead logging

- B. Shadow Paging

- C. Checkpoints

- D. Rollback

- Answer: A. Write-ahead logging

21. Which recovery method involves periodically writing the database state to stable storage, allowing the
system to restore the database to this consistent state in case of failure?

- A. Checkpoints

- B. Write-ahead logging

- C. Shadow Paging

- D. Rollback

- Answer: A. Checkpoints

22. What is the primary purpose of a redo log in the context of database recovery?

- A. To maintain a history of all committed transactions

- B. To undo uncommitted transactions

- C. To track changes made to the database during normal operation


- D. To re-apply committed transactions' changes to the database during recovery

- Answer: D. To re-apply committed transactions' changes to the database during recovery

23. Which recovery method involves undoing the changes made by incomplete transactions by restoring
the database to its state prior to the start of those transactions?

- A. Write-ahead logging

- B. Shadow Paging

- C. Rollback

- D. Checkpoints

- Answer: C. Rollback

24. In the context of database recovery, what is the role of a recovery manager?

- A. To manage the recovery process after a system crash

- B. To manage database access permissions

- C. To optimize query execution plans

- D. To handle database backups

- Answer: A. To manage the recovery process after a system crash

25. Which recovery method involves maintaining multiple copies of the database, allowing the system to
switch to a different copy in case of failure?

- A. Rollback

- B. Database mirroring

- C. Checkpoints

- D. Write-ahead logging

- Answer: B. Database mirroring

26. What is a disadvantage of using database mirroring as a recovery method?

- A. High overhead for maintaining transaction logs

- B. Inability to handle concurrent transactions effectively

- C. Requires additional hardware and network resources


- D. Increased storage space requirements for maintaining multiple copies of the database

- Answer: C. Requires additional hardware and network resources

7. What is a drawback of using shadow paging as a recovery method?

- A. High overhead for maintaining transaction logs

- B. Inability to handle concurrent transactions effectively

- C. Requires frequent synchronization with the disk

- D. Increased storage space requirements for maintaining shadow copies

- Answer: D. Increased storage space requirements for maintaining shadow copies

8. Which recovery method provides the highest level of durability and is commonly used in modern
database systems?

- A. Rollback

- B. Shadow Paging

- C. Checkpoints

- D. Write-ahead logging

- Answer: D. Write-ahead logging

9. In write-ahead logging, what is the order of operations during transaction processing?

- A. Write to the log, write to the database

- B. Write to the database, write to the log

- C. Write to the log, checkpoint, write to the database

- D. Write to the database, checkpoint, write to the log

- Answer: A. Write to the log, write to the database

10. Which recovery method provides the fastest recovery time but may result in increased overhead
during normal operation due to the need for frequent checkpoints?

- A. Rollback

- B. Shadow Paging

- C. Checkpoints
- D. Write-ahead logging

- Answer: C. Checkpoints

1. Which recovery method involves maintaining a log of all changes made to the database and replaying
these changes during recovery to restore the database to a consistent state?

- A. Checkpoints

- B. Shadow Paging

- C. Write-ahead logging

- D. Rollback

- Answer: C. Write-ahead logging

2. What is the first step in the recovery process using write-ahead logging (WAL) after a database failure?

- A. Reapplying committed transactions' changes to the database

- B. Reverting any changes made by incomplete transactions

- C. Writing log records before modifying the database

- D. Synchronizing the database buffers with the disk

- Answer: B. Reverting any changes made by incomplete transactions

3. In the context of recovery using write-ahead logging (WAL), what is the purpose of the redo phase?

- A. To reapply committed transactions' changes to the database during recovery

- B. To undo the changes made by incomplete transactions during recovery

- C. To synchronize the database buffers with the disk

- D. To track changes made to the database during normal operation

- Answer: A. To reapply committed transactions' changes to the database during recovery

4. Consider a scenario where a transaction modifies several records in the database. Before committing,
the changes are written to the transaction log. If a system crash occurs, what is the next step in the
recovery process using write-ahead logging (WAL)?

- A. Reverting any changes made by incomplete transactions

- B. Reapplying committed transactions' changes to the database

- C. Synchronizing the database buffers with the disk


- D. Replaying the log records to restore the database to a consistent state

- Answer: D. Replaying the log records to restore the database to a consistent state

5. Which recovery method involves periodically saving the database state to stable storage, allowing the
system to restore the database to this consistent state in case of failure?

- A. Checkpoints

- B. Shadow Paging

- C. Write-ahead logging

- D. Rollback

- Answer: A. Checkpoints

6. Describe the recovery process using checkpoints in a database system, and explain the difference
between roll-forward and roll-backward techniques.

- A. Roll-forward involves applying transactions recorded after the checkpoint, while roll-backward
involves undoing transactions recorded after the checkpoint.

- B. Roll-forward involves undoing transactions recorded after the checkpoint, while roll-backward
involves applying transactions recorded after the checkpoint.

- C. Both roll-forward and roll-backward involve applying transactions recorded after the checkpoint.

- D. Both roll-forward and roll-backward involve undoing transactions recorded after the checkpoint.

- Answer: A. Roll-forward involves applying transactions recorded after the checkpoint, while roll-
backward involves undoing transactions recorded after the checkpoint.

7. In a database system using shadow paging, what is the first step in the recovery process after a system
crash?

- A. Reapplying committed transactions' changes to the database

- B. Reverting any changes made by incomplete transactions

- C. Restoring the database to a previously consistent state using the shadow copy

- D. Synchronizing the database buffers with the disk

- Answer: C. Restoring the database to a previously consistent state using the shadow copy

8. Which recovery method involves maintaining multiple copies of the database, allowing the system to
switch to a different copy in case of failure?
- A. Checkpoints

- B. Write-ahead logging

- C. Database mirroring

- D. Rollback

- Answer: C. Database mirroring

9. What is a disadvantage of using database mirroring as a recovery method?

- A. High overhead for maintaining transaction logs

- B. Inability to handle concurrent transactions effectively

- C. Requires additional hardware and network resources

- D. Increased storage space requirements for maintaining multiple copies of the database

- Answer: C. Requires additional hardware and network resources

10. In the context of recovery using database mirroring, what is the process called when the standby
database takes over as the primary database in case of a failure?

- A. Failover

- B. Rollback

- C. Checkpoint

- D. Redo

- Answer: A. Failover

11. Which recovery method involves periodically writing the database state to stable storage, allowing the
system to restore the database to this consistent state in case of failure?

- A. Checkpoints

- B. Shadow Paging

- C. Rollback

- D. Write-ahead logging

- Answer: A. Checkpoints

12. Consider a scenario where a system crash occurs, and the recovery process starts from the latest
checkpoint. What is the next step after restoring the database to the checkpoint state?

- A. Reapplying committed transactions' changes to the database


- B. Reverting any changes made by incomplete transactions

- C. Synchronizing the database buffers with the disk

- D. Replaying the log records to restore the database to a consistent state

- Answer: A. Reapplying committed transactions' changes to the database

13. What is the primary purpose of a recovery point objective (RPO) in the context of database recovery?

- A. To define the maximum acceptable downtime for the database

- B. To define the maximum acceptable data loss in case of a failure

- C. To define the recovery time for the database

- D. To define the frequency of database backups

- Answer: B. To define the maximum acceptable data loss in case of a failure

14. Which recovery method involves undoing the changes made by incomplete transactions by restoring
the database to its state prior to the start of those transactions?

- A. Write-ahead logging

- B. Shadow Paging

- C. Rollback

- D. Checkpoints

- Answer: C. Rollback

15. In the context of database recovery, what is the role of a recovery manager?

- A. To manage the recovery process after a system crash

- B. To manage database access permissions

- C. To optimize query execution plans

- D. To handle database backups

Answer A

16. : Write-ahead Logging (WAL)**

After a system crash, a database administrator is tasked with recovering the database using write-ahead
logging (WAL). Describe the step-by-step process the administrator would follow to restore the database
to a consistent state, starting from the detection of the crash.
- A. Identify the log sequence number (LSN) of the last checkpoint, replay the log records from that
point forward, apply committed transactions' changes to the database, and finally, undo any incomplete
transactions' changes.

- B. Revert the database to the last checkpoint, apply committed transactions' changes to the database,
and then synchronize the database buffers with the disk.

- C. Create a shadow copy of the database, revert the database to the last checkpoint, and reapply
committed transactions' changes to the database.

- D. Revert the database to the last checkpoint, apply committed transactions' changes to the database,
and then write log records to the transaction log.

- Answer: A. Identify the log sequence number (LSN) of the last checkpoint, replay the log records from
that point forward, apply committed transactions' changes to the database, and finally, undo any
incomplete transactions' changes.

17. : Database Mirroring**

In a database system utilizing database mirroring, the primary database experiences a hardware failure,
triggering failover to the standby database. Describe the process of failover and the actions taken to
ensure data consistency and availability.

- A. The standby database takes over as the primary database, and clients are redirected to it for data
access. The system replays the log records to reapply committed transactions' changes and synchronize
the standby database with the primary database's state.

- B. The primary database is restored from the latest checkpoint, and clients are redirected to it for data
access. The system synchronizes the database buffers with the disk to ensure data consistency.

- C. The primary database is restored from a backup, and clients are redirected to it for data access. The
system replays the log records to reapply committed transactions' changes and undo any incomplete
transactions' changes.

- D. The standby database takes over as the primary database, and clients are redirected to it for data
access. The system creates a shadow copy of the database to ensure data consistency.

- Answer: A. The standby database takes over as the primary database, and clients are redirected to it
for data access. The system replays the log records to reapply committed transactions' changes and
synchronize the standby database with the primary database's state.

18 . : Checkpoints

During normal operation, a database system periodically creates checkpoints to facilitate recovery in
case of a failure. Explain how checkpoints are used in the recovery process and their role in ensuring data
consistency.
- A. Checkpoints involve periodically flushing the database's dirty pages to disk along with a checkpoint
record indicating the current state of the database. During recovery, the system can use the latest
checkpoint to roll forward or roll back transactions, ensuring a consistent database state.

- B. Checkpoints involve maintaining multiple copies of the database, allowing the system to switch to a
different copy in case of failure. During recovery, the system selects the most recent copy to restore the
database to a consistent state.

- C. Checkpoints involve periodically saving the database state to stable storage, allowing the system to
restore the database to this consistent state in case of failure. During recovery, the system replays the log
records to reapply committed transactions' changes and synchronize the database with the checkpoint
state.

- D. Checkpoints involve creating a shadow copy of the database, allowing the system to revert to a
previous state in case of failure. During recovery, the system restores the database to the checkpoint state
and reverts any incomplete transactions' changes.

- Answer: A. Checkpoints involve periodically flushing the database's dirty pages to disk along with a
checkpoint record indicating the current state of the database. During recovery, the system can use the
latest checkpoint to roll forward or roll back transactions, ensuring a consistent database state.

20. : Hybrid Recovery Methods**

In a complex database environment, a hybrid approach combining write-ahead logging (WAL) and
database mirroring is implemented for recovery. Explain how this hybrid approach enhances data
protection and recovery efficiency, providing specific examples of when each method would be utilized.

- A. Write-ahead logging (WAL) ensures durable changes to the database, while database mirroring
provides high availability through synchronized copies of the database. During recovery, WAL is used to
replay log records for consistency, while database mirroring facilitates failover to the standby database for
minimal downtime.

- B. Write-ahead logging (WAL) records changes before they are applied to the database, while
database mirroring maintains synchronized copies of the database for failover. During recovery, WAL is
used to reapply committed transactions' changes, while database mirroring ensures data availability by
switching to the standby database.

- C. Write-ahead logging (WAL) maintains a log of changes for recovery, while database mirroring
creates redundant copies of the database. During recovery, WAL is used to roll forward changes, while
database mirroring ensures failover to the standby database for uninterrupted service.

- D. Write-ahead logging (WAL) and database mirroring both record changes to the database. During
recovery, WAL is used to undo incomplete transactions' changes, while database mirroring ensures data
availability by providing a standby database for failover.

- Answer: A. Write-ahead logging (WAL) ensures durable changes to the database, while database
mirroring provides high availability through synchronized copies of the database. During recovery, WAL
is used to replay log records for consistency, while database mirroring facilitates failover to the standby
database for minimal downtime.

21 : Recovery Point Objective (RPO)**

A company has strict recovery point objectives (RPOs) due to regulatory requirements. Explain how
different recovery methods, such as write-ahead logging (WAL), database mirroring, and checkpoints,
impact the company's ability to meet its RPOs. Provide examples of scenarios where each method may be
advantageous or disadvantageous in meeting RPOs.

- A. Write-ahead logging (WAL) provides granular recovery capabilities, allowing the company to
restore the database to a specific point in time. Database mirroring ensures continuous data availability
but may have higher RPOs due to potential data loss during failover. Checkpoints offer regular recovery
points but may not meet stringent RPO requirements in case of frequent system crashes.

- B. Database mirroring ensures zero data loss by maintaining synchronized copies of the database,
making it ideal for meeting strict RPOs. Write-ahead logging (WAL) offers recovery to a specific point in
time but may have higher RPOs if log backups are not frequent. Checkpoints provide regular recovery
points but may not offer granular recovery capabilities required for stringent RPOs.

- C. Write-ahead logging (WAL) ensures zero data loss by recording changes before they are applied to
the database, making it ideal for meeting strict RPOs. Database mirroring offers continuous data
availability but may have higher RPOs due to potential data loss during failover. Checkpoints provide
regular recovery points but may not meet stringent RPO requirements in case of frequent system crashes.

- D. Checkpoints offer zero data loss by regularly saving the database state to stable storage, making
them ideal for meeting strict RPOs. Write-ahead logging (WAL) and database mirroring provide
continuous data availability but may have higher RPOs due to potential data loss during recovery.

- Answer: A. Write-ahead logging (WAL) provides granular recovery capabilities, allowing the
company to restore the database to a specific point in time. Database mirroring ensures continuous data
availability but may have higher RPOs due to potential data loss during failover. Checkpoints offer
regular recovery points but may not meet stringent RPO requirements in case of frequent system crashes.

 distributed database system in homogenous and heterogeneous


environments

1. What is the primary difference between a homogeneous and a heterogeneous distributed database
environment?

- A. Homogeneous environments use a single type of database management system (DBMS), while
heterogeneous environments use multiple types of DBMS.
- B. Homogeneous environments have a single database schema across all sites, while heterogeneous
environments have different schemas at each site.

- C. Homogeneous environments are easier to manage but have limited scalability, while heterogeneous
environments offer more flexibility but are more complex to manage.

- D. Homogeneous environments allow for seamless data sharing and transaction processing, while
heterogeneous environments require data translation and coordination between different DBMSs.

- Answer: A. Homogeneous environments use a single type of database management system (DBMS),
while heterogeneous environments use multiple types of DBMS.

2. In a homogeneous distributed database system, what is the role of the distributed database management
system (DDBMS)?

- A. To manage the distribution of data across multiple sites and coordinate transactions between them.

- B. To translate queries and transactions between different DBMSs to ensure interoperability.

- C. To replicate data across multiple sites for fault tolerance and high availability.

- D. To optimize query processing and resource allocation across distributed sites to improve
performance.

- Answer: A. To manage the distribution of data across multiple sites and coordinate transactions
between them.

3. Which strategy is commonly used to ensure data consistency in a homogeneous distributed database
environment?

- A. Two-phase commit protocol

- B. Three-phase commit protocol

- C. Optimistic concurrency control

- D. Pessimistic concurrency control

- Answer: A. Two-phase commit protocol

4. In a heterogeneous distributed database environment, what is a major challenge in ensuring data


consistency across different DBMSs?

- A. Limited scalability of the distributed system

- B. Incompatibility of transaction models and data types between DBMSs

- C. Lack of fault tolerance mechanisms

- D. Difficulty in distributing query processing efficiently


- Answer: B. Incompatibility of transaction models and data types between DBMSs

5. What is a key advantage of using data replication in a distributed database system?

- A. Improved fault tolerance and high availability

- B. Reduced network latency for distributed queries

- C. Simplified query processing and optimization

- D. Enhanced security and access control

- Answer: A. Improved fault tolerance and high availability

6. Which mechanism is commonly used to maintain data consistency in a replicated distributed database
system?

- A. Lazy replication

- B. Eager replication

- C. Primary copy replication

- D. Multi-master replication

- Answer: C. Primary copy replication

7. In a multi-master replication model, what is the main advantage compared to other replication models?

- A. Improved fault tolerance

- B. Lower latency for distributed transactions

- C. Enhanced scalability and load balancing

- D. Simplified conflict resolution and data reconciliation

- Answer: C. Enhanced scalability and load balancing

8. Which factor is critical for the performance of distributed database systems in terms of query
processing and transaction management?

- A. Network bandwidth

- B. CPU speed

- C. Disk storage capacity

- D. Memory size

- Answer: A. Network bandwidth


9. What is the primary role of a distributed query optimizer in a distributed database system?

- A. To minimize query response time by optimizing query execution plans across distributed sites

- B. To ensure data consistency and isolation levels for distributed transactions

- C. To manage data distribution and replication strategies for fault tolerance

- D. To enforce security policies and access controls across distributed sites

- Answer: A. To minimize query response time by optimizing query execution plans across distributed
sites

10. Which technique is commonly used to improve the fault tolerance of distributed database systems by
replicating data across multiple geographically dispersed sites?

- A. Partitioning

- B. Sharding

- C. Data mirroring

- D. Data fragmentation

- Answer: C. Data mirroring

11. Which of the following statements best describes the concept of data fragmentation in a distributed
database system?

- A. Data fragmentation refers to the process of dividing a database into smaller, manageable units for
distribution across multiple sites.

- B. Data fragmentation involves replicating data across multiple sites to ensure fault tolerance and
high availability.

- C. Data fragmentation refers to the process of optimizing query execution by distributing query
processing tasks across multiple nodes.

- D. Data fragmentation involves translating queries and transactions between different types of
database management systems (DBMS).

- Answer: A. Data fragmentation refers to the process of dividing a database into smaller, manageable
units for distribution across multiple sites.

12. In a distributed database system, what is the role of a data dictionary or directory?

- A. To manage data replication and synchronization across distributed sites.

- B. To provide a centralized repository of metadata, including schema information, location of data


fragments, and access permissions.
- C. To optimize query execution plans and distribute query processing tasks across multiple nodes.

- D. To enforce security policies and access controls across distributed sites.

- Answer: B. To provide a centralized repository of metadata, including schema information, location


of data fragments, and access permissions.

13.. In a distributed database system, what is the main challenge associated with maintaining data
consistency in a multi-master replication model?

- A. Data fragmentation across distributed sites.

- B. Incompatibility of transaction models between different DBMSs.

- C. Potential conflicts and inconsistencies due to concurrent updates at multiple sites.

- D. Difficulty in optimizing query execution plans across distributed sites.

- Answer: C. Potential conflicts and inconsistencies due to concurrent updates at multiple sites.

14. Which of the following statements best describes the concept of data transparency in a distributed
database system?

- A. Data transparency refers to the ability to access and manipulate data without knowing its physical
location or distribution across distributed sites.

- B. Data transparency refers to the encryption of sensitive data to ensure confidentiality and privacy in
a distributed environment.

- C. Data transparency refers to the process of replicating data across multiple sites to ensure fault
tolerance and high availability.

- D. Data transparency refers to the consistency of data representations and formats across different
types of database management systems (DBMSs).

- Answer: A. Data transparency refers to the ability to access and manipulate data without knowing its
physical location or distribution across distributed sites.

15. In a distributed database system, what is the purpose of a distributed deadlock detection and
resolution mechanism?

- A. To identify and resolve deadlocks that occur within a single site.

- B. To detect and resolve deadlocks that occur across distributed sites.

- C. To prevent the occurrence of deadlocks by optimizing resource allocation and transaction


scheduling.

- D. To manage data replication and synchronization across distributed sites.


- Answer: B. To detect and resolve deadlocks that occur across distributed sites.

16. Which of the following techniques is commonly used to optimize query processing in a distributed
database system by minimizing data transfer across distributed sites?

- A. Fragmentation

- B. Replication

- C. Partitioning

- D. Sharding

- Answer: C. Partitioning

17. In a distributed database system, what is the role of a distributed transaction monitor?

- A. To manage data replication and synchronization across distributed sites.

- B. To enforce security policies and access controls across distributed sites.

- C. To coordinate and monitor distributed transactions, ensuring atomicity, consistency, isolation, and
durability (ACID) properties.

- D. To optimize query execution plans and distribute query processing tasks across multiple nodes.

- Answer: C. To coordinate and monitor distributed transactions, ensuring atomicity, consistency,


isolation, and durability (ACID) properties.

18. Which of the following is a characteristic of a distributed database system in a heterogeneous


environment?

- A. Unified data models and transaction processing across all sites.

- B. Consistency in hardware and network configurations across all sites.

- C. Compatibility of data formats and DBMS types across distributed sites.

- D. Uniformity in query optimization techniques across all sites.

- Answer: C. Compatibility of data formats and DBMS types across distributed sites.

19. In a distributed database system, what is the primary goal of data fragmentation?

- A. To reduce data redundancy and improve storage efficiency.

- B. To distribute data across multiple sites for fault tolerance.

- C. To simplify query processing and optimization.

- D. To ensure data consistency and integrity.


- Answer: C. To simplify query processing and optimization.

20. Which of the following is a key advantage of using a distributed database system over a centralized
database system?

- A. Improved data security and access control.

- B. Enhanced scalability and fault tolerance.

- C. Simplified query processing and optimization.

- D. Lower network latency and faster response times.

- Answer: B. Enhanced scalability and fault tolerance.

21. What is the primary role of a distributed database management system (DDBMS) in a distributed
database environment?

- A. To manage data replication and synchronization across distributed sites.

- B. To enforce security policies and access controls across distributed sites.

- C. To optimize query execution plans and distribute query processing tasks across multiple nodes.

- D. To manage the distribution of data across multiple sites and coordinate transactions between them.

- Answer: D. To manage the distribution of data across multiple sites and coordinate transactions
between them.

22. Which of the following techniques is commonly used to ensure data consistency in a distributed
database system with replicated data?

- A. Lazy replication

- B. Eager replication

- C. Primary copy replication

- D. Multi-master replication

- Answer: C. Primary copy replication

23. In a distributed database system, what is the purpose of a distributed deadlock detection algorithm?

- A. To prevent deadlocks by optimizing resource allocation.

- B. To identify and resolve deadlocks that occur within a single site.

- C. To detect and resolve deadlocks that occur across distributed sites.

- D. To manage data replication and synchronization across distributed sites.


- Answer: C. To detect and resolve deadlocks that occur across distributed sites.

24. Which of the following strategies is commonly used to optimize query processing in a distributed
database system by distributing data and query execution tasks across multiple nodes?

- A. Materialized views

- B. Data partitioning

- C. Data replication

- D. Multi-version concurrency control

- Answer: B. Data partitioning

25. In a distributed database environment, what is the primary purpose of a distributed transaction
coordinator?

- A. To manage data replication and synchronization across distributed sites.

- B. To coordinate transactions across multiple sites, ensuring atomicity, consistency, isolation, and
durability (ACID) properties.

- C. To enforce security policies and access controls across distributed sites.

- D. To optimize query execution plans and distribute query processing tasks across multiple nodes.

- Answer: B. To coordinate transactions across multiple sites, ensuring atomicity, consistency,


isolation, and durability (ACID) properties.

26. Which of the following is a major challenge in maintaining data consistency in a distributed database
system with heterogeneous DBMSs?

- A. Incompatibility of data formats and DBMS types across distributed sites.

- B. Limited scalability and fault tolerance of the distributed system.

- C. Difficulty in optimizing query execution plans across distributed sites.

- D. Complexity in managing data replication and synchronization.

- Answer: A. Incompatibility of data formats and DBMS types across distributed sites.

27. In a distributed database system, what is the primary role of a distributed query optimizer?

- A. To ensure fault tolerance and high availability of data across distributed sites.

- B. To minimize query response time by optimizing query execution plans across distributed sites.

- C. To enforce security policies and access controls across distributed sites.


- D. To manage data replication and synchronization across distributed sites.

- Answer: B. To minimize query response time by optimizing query execution plans across distributed
sites.

 transaction management procedure

1. Which of the following best describes the concept of a database transaction?

- A. A unit of work that consists of multiple SQL statements executed sequentially.

- B. A logical operation performed on the database that either completes successfully or is rolled back.

- C. A set of database operations that are isolated from other transactions until they are committed.

- D. An atomic operation that modifies data in the database and ensures data consistency.

- Answer: B. A logical operation performed on the database that either completes successfully or is
rolled back.

2. What is the purpose of the ACID properties in transaction management?

- A. To ensure data integrity and consistency in the database.

- B. To optimize query performance and resource utilization.

- C. To enforce security policies and access controls.

- D. To define the structure and relationships of database objects.

- Answer: A. To ensure data integrity and consistency in the database.

3. Which of the following ACID properties ensures that transactions are executed in a way that preserves
the consistency of the database?

- A. Atomicity

- B. Consistency

- C. Isolation

- D. Durability

- Answer: B. Consistency

4. In the context of transaction management, what does the term "atomicity" refer to?
- A. The ability to execute multiple transactions concurrently without interfering with each other.

- B. The property that ensures all operations within a transaction are completed successfully or none of
them are applied.

- C. The isolation of transactions from each other to prevent interference and maintain data consistency.

- D. The ability to recover committed transactions in case of system failure or error.

- Answer: B. The property that ensures all operations within a transaction are completed successfully or
none of them are applied.

5. Which of the following is an example of a transaction isolation level that provides the highest level of
data consistency but may result in reduced concurrency?

- A. Read Uncommitted

- B. Read Committed

- C. Repeatable Read

- D. Serializable

- Answer: D. Serializable

6. What is the primary purpose of the two-phase commit protocol in transaction management?

- A. To ensure that transactions are executed with high performance and concurrency.

- B. To coordinate distributed transactions across multiple databases and ensure atomicity.

- C. To provide mechanisms for recovering data in case of system failure or error.

- D. To enforce security policies and access controls for database transactions.

- Answer: B. To coordinate distributed transactions across multiple databases and ensure atomicity.

7. In the context of transaction management, what does the term "isolation" refer to?

- A. The property that ensures all operations within a transaction are completed successfully or none of
them are applied.

- B. The ability to execute multiple transactions concurrently without interfering with each other.

- C. The ability to recover committed transactions in case of system failure or error.

- D. The degree to which the effects of one transaction are visible to other concurrent transactions.

- Answer: D. The degree to which the effects of one transaction are visible to other concurrent
transactions.
8. Which of the following is a technique used to handle deadlock situations in transaction management?

- A. Timeouts

- B. Rollback

- C. Locking

- D. Checkpoints

- Answer: A. Timeouts

9. What is the purpose of a transaction log in transaction management?

- A. To record all changes made to the database during a transaction for recovery purposes.

- B. To store metadata about database objects and their relationships.

- C. To maintain a history of all transactions executed on the database for auditing purposes.

- D. To optimize query execution plans and improve database performance.

- Answer: A. To record all changes made to the database during a transaction for recovery purposes.

10. Which of the following statements best describes the concept of transaction durability?

- A. It ensures that all changes made by a committed transaction are permanent and survive system
failures.

- B. It ensures that transactions are isolated from each other to prevent interference and maintain data
consistency.

- C. It ensures that all operations within a transaction are completed successfully or none of them are
applied.

- D. It ensures that transactions are executed with high performance and concurrency.

- Answer: A. It ensures that all changes made by a committed transaction are permanent and survive
system failures.

11. What is the role of a transaction manager in a database system?

- A. To manage the physical storage of data on disk.

- B. To enforce security policies and access controls.

- C. To coordinate the execution of transactions and ensure their atomicity, consistency, isolation, and
durability (ACID) properties.

- D. To optimize query execution plans for improved performance.


- Answer: C. To coordinate the execution of transactions and ensure their atomicity, consistency,
isolation, and durability (ACID) properties.

12. Which of the following is an example of a scenario where a transaction rollback might be necessary?

- A. A transaction completes successfully, and its changes are committed to the database.

- B. A transaction encounters an error during execution, and its changes need to be undone.

- C. A transaction is waiting for a lock on a resource held by another transaction.

- D. A transaction is executed with a higher isolation level to ensure data consistency.

- Answer: B. A transaction encounters an error during execution, and its changes need to be undone.

13. In the context of transaction management, what does the term "serializability" refer to?

- A. The property that ensures all operations within a transaction are completed successfully or none of
them are applied.

- B. The degree to which the effects of one transaction are visible to other concurrent transactions.

- C. The ability to execute multiple transactions concurrently without interfering with each other.

- D. The consistency of the database when transactions are executed concurrently, as if they were
executed sequentially.

- Answer: D. The consistency of the database when transactions are executed concurrently, as if they
were executed sequentially.

14. Which of the following isolation levels allows a transaction to read data that has been modified but
not yet committed by other transactions?

- A. Read Uncommitted

- B. Read Committed

- C. Repeatable Read

- D. Serializable

- Answer: A. Read Uncommitted

15. What is the purpose of a savepoint in transaction management?

- A. To record the beginning of a transaction.

- B. To mark a point within a transaction to which it can be rolled back.

- C. To commit the changes made by a transaction to the database.


- D. To release locks held by a transaction on database resources.

- Answer: B. To mark a point within a transaction to which it can be rolled back.

16. Which of the following concurrency control techniques allows transactions to access data
concurrently while ensuring data consistency by locking resources?

- A. Two-phase locking

- B. Optimistic concurrency control

- C. Multi-version concurrency control

- D. Timestamp-based concurrency control

- Answer: A. Two-phase locking

17. In the context of transaction management, what does the term "deadlock" refer to?

- A. A situation where a transaction encounters an error and cannot proceed.

- B. A situation where two or more transactions are waiting indefinitely for each other to release
resources, preventing progress.

- C. A situation where a transaction performs a series of operations atomically.

- D. A situation where multiple transactions are executed concurrently without interfering with each
other.

- Answer: B. A situation where two or more transactions are waiting indefinitely for each other to
release resources, preventing progress.

18. Which of the following techniques is used to detect and resolve deadlocks in transaction
management?

- A. Timeout

- B. Rollback

- C. Locking

- D. Wait-for graph

- Answer: D. Wait-for graph

19. What is the purpose of a transaction commit in transaction management?

- A. To mark the beginning of a transaction.

- B. To release locks held by a transaction on database resources.


- C. To mark the successful completion of a transaction and make its changes permanent.

- D. To roll back a transaction and undo its changes to the database.

- Answer: C. To mark the successful completion of a transaction and make its changes permanent.

20. Which of the following statements best describes the concept of transaction durability in transaction
management?

- A. It ensures that transactions are isolated from each other to prevent interference and maintain data
consistency.

- B. It ensures that all changes made by a committed transaction are permanent and survive system
failures.

- C. It ensures that all operations within a transaction are completed successfully or none of them are
applied.

- D. It ensures that transactions are executed with high performance and concurrency.

- Answer: B. It ensures that all changes made by a committed transaction are permanent and survive
system failures.

21. Which of the following best describes the concept of a nested transaction?

- A. A transaction that contains sub-transactions within its scope, each with its own commit and
rollback operations.

- B. A transaction that spans multiple databases across different servers.

- C. A transaction that has a higher isolation level than other transactions in the system.

- D. A transaction that is executed concurrently with other transactions without interfering with each
other.

- Answer: A. A transaction that contains sub-transactions within its scope, each with its own commit
and rollback operations.

22. What is the primary role of a transaction coordinator in distributed transaction management?

- A. To manage data replication and synchronization across distributed sites.

- B. To enforce security policies and access controls across distributed sites.

- C. To coordinate transactions across multiple databases, ensuring atomicity and consistency.

- D. To optimize query execution plans and distribute query processing tasks across multiple nodes.

- Answer: C. To coordinate transactions across multiple databases, ensuring atomicity and consistency.
23. Which of the following mechanisms is commonly used to ensure consistency and isolation in
distributed transactions?

- A. Two-phase commit protocol

- B. Optimistic concurrency control

- C. Multi-version concurrency control

- D. Timestamp-based concurrency control

- Answer: A. Two-phase commit protocol

24. What is the primary purpose of a transaction recovery manager in a database system?

- A. To optimize query execution plans and improve database performance.

- B. To enforce security policies and access controls for database transactions.

- C. To coordinate the execution of transactions and ensure their atomicity, consistency, isolation, and
durability (ACID) properties.

- D. To restore the database to a consistent state after a system failure or error.

- Answer: D. To restore the database to a consistent state after a system failure or error.

25. Which of the following statements is true regarding the durability property of a transaction?

- A. Durability ensures that a transaction is executed in its entirety or not at all.

- B. Durability guarantees that the effects of a committed transaction persist even after a system crash.

- C. Durability prevents transactions from interfering with each other during concurrent execution.

- D. Durability ensures that transactions are isolated from each other to maintain data consistency.

- Answer: B. Durability guarantees that the effects of a committed transaction persist even after a
system crash.

26. What is the purpose of a transaction timestamp in a timestamp-based concurrency control


mechanism?

- A. To record the time at which a transaction began.

- B. To identify the order in which transactions access data items for conflict resolution.

- C. To track the progress of a transaction during its execution.

- D. To enforce a strict ordering of transactions based on their timestamps.

- Answer: B. To identify the order in which transactions access data items for conflict resolution.
27. Which of the following is a potential drawback of using a high isolation level, such as Serializable, in
transaction management?

- A. Reduced likelihood of encountering concurrency-related issues.

- B. Increased risk of deadlock situations.

- C. Improved performance due to fewer locking conflicts.

- D. Decreased level of data consistency and integrity.

- Answer: B. Increased risk of deadlock situations

28. What is the primary purpose of a transaction log buffer in transaction management?

- A. To store intermediate results of query processing.

- B. To maintain a history of all transactions executed on the database.

- C. To record changes made by transactions to the database before they are permanently written to
disk.

- D. To manage concurrent access to shared resources by multiple transactions.

- Answer: C. To record changes made by transactions to the database before they are permanently
written to disk.

29. Which of the following techniques is commonly used to minimize the overhead of transaction logging
in a database system?

- A. Lazy write

- B. Eager write

- C. Checkpointing

- D. Shadow paging

- Answer: A. Lazy write

30. What is the primary purpose of a transaction commit point in transaction management?

- A. To mark the beginning of a transaction.

- B. To identify the point at which a transaction is considered complete and its changes are made
permanent.

- C. To release locks held by a transaction on database resources.

- D. To roll back a transaction and undo its changes to the database.


- Answer: B. To identify the point at which a transaction is considered complete and its changes are
made permanent.

You might also like