Difficulty: Easy
Correct Answer: Dynamic cursor.
Explanation:
Introduction / Context:
In relational databases, a cursor defines how an application scans a result set and what changes it can “see” while it is open. Understanding the visibility guarantees of each cursor type is essential for writing correct, concurrent applications that avoid stale views of data or surprising anomalies.
Given Data / Assumptions:
Concept / Approach:
A dynamic cursor is defined so that it reflects the current, committed state of the underlying tables. By contrast, a static cursor is a snapshot taken when the cursor opens, a keyset cursor has a fixed key list with values refreshed for those keys, and a forward-only cursor is a simple streaming cursor with limited navigation and implementation-dependent visibility. The question asks which cursor shows any type of committed change from any source while it is open—this is precisely the property of a dynamic cursor.
Step-by-Step Solution:
Verification / Alternative check:
Vendor documentation (e.g., SQL Server's cursor types) describes dynamic cursors as showing all committed changes, confirming our reasoning independent of implementation details.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
Dynamic cursor.
Discussion & Comments