Practice
Solution
Step 1: Understand denormalized data updates
Denormalization duplicates data, so updates must be applied to all copies to maintain consistency.Step 2: Analyze update propagation
Most systems require explicit or programmatic updates to each redundant copy; automatic propagation is rare.Step 3: Evaluate options
The update occurs once in the primary table and automatically propagates to all redundant copies without delay incorrectly assumes automatic propagation without delay. The database engine prevents updates to denormalized fields to maintain integrity is false; updates are allowed but complex. Updates are queued and applied asynchronously, ensuring eventual consistency but possible stale reads describes an eventual consistency model, which may apply but is not guaranteed.Final Answer:
Option A -> Option AQuick Check:
Manual or programmatic updates risk temporary inconsistency in denormalized data [OK]
- Assuming automatic update propagation
- Believing denormalized fields are immutable
- Confusing synchronous and asynchronous update models
Solution
Step 1: Understand CAP priorities
The database prioritizes availability and partition tolerance, so it must remain operational during partitions.Step 2: Effect on writes and reads
Writes continue independently on partitioned nodes to maintain availability, which can cause data divergence.Step 3: Impact on consistency
Because nodes can't synchronize during partition, clients may read stale or divergent data temporarily.Final Answer:
Option A -> Option AQuick Check:
Availability + Partition tolerance -> possible stale reads during partition [OK]
- Assuming writes are blocked to maintain consistency
- Believing reads are rejected during partitions
- Thinking consistency is instantly restored during partition
Solution
Step 1: Understand 2PL's purpose
2PL ensures serializability by acquiring locks in a growing phase and releasing them in a shrinking phase, which is essential when transactions perform both reads and writes.Step 2: Analyze each option
A is incorrect because 2PL is not necessary if only reads occur; shared locks suffice without strict 2PL. B is unrelated as optimistic concurrency control avoids locking. C is wrong since deadlocks can occur regardless of transaction length. D correctly identifies the scenario where 2PL is most appropriate.Final Answer:
Option B -> Option BQuick Check:
2PL is designed for mixed read-write transactions requiring strict serializability.
- Assuming 2PL is needed for read-only transactions
- Believing short transactions cannot deadlock
- Confusing locking with optimistic concurrency
Solution
Step 1: Check lossless join condition
Each pair of relations shares a key attribute: R1 and R2 share B (key in R2), R2 and R3 share C (key in R3), so lossless join holds.Step 2: Check dependency preservation
All FDs appear in one of the relations: A -> B in R1, B -> C in R2, C -> D in R3.Step 3: Confirm no FD requires join enforcement
Each FD is enforceable in its own relation, so dependency preservation holds.Final Answer:
Option B -> Option BQuick Check:
Options A, B, and C incorrectly claim loss or preservation failures.
- Assuming chain dependencies require joins to enforce
- Believing lossless join requires all keys in all relations
- Confusing dependency preservation with global key presence
LIMIT is applied without an ORDER BY clause. Which of the following statements about the behavior of LIMIT in this case is correct, and what adjustment should be made to the simulation to reflect real SQL behavior?Solution
Step 1: Understand LIMIT behavior without ORDER BY
Without ORDER BY, LIMIT returns an arbitrary subset of rows, not sorted, so results may be inconsistent.Step 2: Adjust simulation to reflect logical execution
Simulation should keep LIMIT as the last clause executed but clarify it does not guarantee sorted output without ORDER BY.Final Answer:
Option D -> Option DQuick Check:
LIMIT applies last but unordered without ORDER BY [OK]
- Assuming LIMIT sorts rows by default
