Normalization, query processing and optimization, transaction processing, concurrency control and recovery techniques. - One Line Questions
1.
Which of the following is an example of a multi-valued dependency? —
A ->> B
2.
What is a transitive dependency in the context of normalization? —
A dependency where a non-key attribute is determined by another non-key attribute, which in turn is determined by the primary key.
3.
What is a 'lock' in the context of concurrency control? —
A mechanism that restricts access to data items by concurrent transactions.
4.
What is a transaction in the context of database management systems? —
A sequence of database operations performed as a single logical unit of work.
5.
What is a deadlock in transaction processing? —
A situation where two or more transactions are waiting indefinitely for each other to release resources.
6.
In a two-phase locking (2PL) protocol, what happens during the 'growing phase'? —
A transaction can acquire locks but not release them.
7.
If a deadlock is detected, what is a common recovery strategy? —
Abort all transactions involved in the deadlock.
8.
Which of the following is a common transaction state? —
Active
9.
A transaction that has been successfully completed and its effects are permanently recorded is in which state? —
Committed
10.
The 'Atomicity' property of a transaction ensures that: —
All operations within the transaction are completed successfully, or none of them are.
11.
Which ACID property ensures that once a transaction is committed, its changes are permanent and will survive system failures? —
Durability
12.
A relation is in Boyce-Codd Normal Form (BCNF) if for every non-trivial functional dependency X -> Y, X is a superkey. What is the main difference between 3NF and BCNF? —
BCNF requires that every determinant must be a candidate key.
13.
Which of the following is a common recovery technique that uses a log of all database modifications? —
Write-Ahead Logging (WAL)
14.
Which of the following is a type of normalization? —
Third Normal Form (3NF)
15.
The 'Isolation' property of a transaction ensures that: —
Each transaction executes as if it were the only transaction running.
16.
Which of the following is a common technique used in query optimization? —
Cost-based optimization using statistics about the data
17.
Which normal form requires that all non-key attributes are fully functionally dependent on the primary key? —
Second Normal Form (2NF)
18.
In which normal form are all transitive dependencies removed? —
Third Normal Form (3NF)
19.
Fourth Normal Form (4NF) addresses which type of dependency? —
Multi-valued dependencies
20.
A schedule is considered 'serializable' if: —
It produces the same final database state as some serial execution of the same transactions.
21.
What is a potential problem with two-phase locking (2PL)? —
It can lead to deadlocks.
22.
Which concurrency control mechanism uses timestamps to order transactions and detect conflicts? —
Timestamp-based protocols
23.
In the context of Write-Ahead Logging (WAL), what does 'write-ahead' mean? —
Log records must be written to stable storage before the corresponding data block is written.
24.
Consider a relation R(A, B, C, D) with functional dependencies {A -> B, C -> D}. If R is decomposed into R1(A, B) and R2(C, D), what type of decomposition is this? —
Lossless join decomposition
25.
Consider a join operation. Which of the following is NOT a common join algorithm? —
Indexed Join
26.
What is the minimal requirement for a relation to be in First Normal Form (1NF)? —
All attributes are atomic.
27.
Which heuristic rule in query optimization aims to perform selections and projections as early as possible? —
Minimizing intermediate results
28.
Which of the following is a typical stage in query processing? —
All of the above
29.
Which isolation level prevents dirty reads, non-repeatable reads, and phantom reads? —
Serializable
30.
What is a 'dirty read' in the context of transaction isolation levels? —
Reading data that has not yet been committed.
31.
What is a 'phantom read' in transaction isolation? —
A transaction re-executing a query and finding new rows that match the query's criteria due to another committed transaction's insertions.
32.
Consider a transaction T that aborts. What action does the recovery manager take? —
Undo T's operations.
33.
What does the 'Consistency' property of a transaction guarantee? —
That the transaction will bring the database from one valid state to another valid state.
34.
What is a schedule in the context of transaction processing? —
The order in which the operations of concurrent transactions are interleaved.
35.
Which of the following is a characteristic of a lossless join decomposition? —
The original relation can be reconstructed by performing a natural join of the decomposed relations.
36.
What is a query plan or execution plan? —
A structured representation of the steps the database system will take to execute a query.
37.
What is a 'log record' in the context of recovery? —
Information about a database operation (e.g., the data modified, the old and new values).
38.
Which technique can be used to detect deadlocks? —
Both timeouts and wait-for graphs
39.
What is the purpose of a cost model in query optimization? —
To estimate the computational cost (e.g., I/O, CPU) of different query execution plans.
40.
What is the primary goal of concurrency control in a database system? —
To prevent database corruption due to simultaneous access by multiple transactions.
41.
What is the primary goal of normalization in a relational database? —
To reduce data redundancy and improve data integrity
42.
What is the role of a 'checkpoint' in recovery? —
To periodically save the state of the database to stable storage, reducing the amount of redo needed during recovery.
43.
What is the purpose of the 'undo' operation during recovery? —
To reverse the effects of aborted or failed transactions.
44.
In query processing, what is the primary goal of query optimization? —
To find the most efficient execution plan for a query.
45.
What is the purpose of the 'redo' operation during recovery? —
To reapply the changes of committed transactions that may not have reached stable storage.
46.
What is the purpose of recovery techniques in a database system? —
To ensure data consistency and durability in the event of failures.
47.
In query optimization, what is the role of database statistics? —
To provide information about the data distribution (e.g., number of distinct values, min/max values) to estimate the cost of operations.
48.
Consider a transaction T that committed successfully but the system crashed before its changes were written to disk. What action does the recovery manager take? —
Redo T's operations.
49.
Which recovery technique involves creating shadow copies of data pages? —
Shadow Paging
50.
If a relation is in 3NF, is it necessarily in 2NF? —
Yes