Difficulty: Easy
Correct Answer: All of the above.
Explanation:
Introduction / Context:
OQL provides SQL-like expressiveness for querying persistent object collections. Similar to SQL, it supports selection, projection, filtering, and duplicate control (e.g., DISTINCT), making it suitable for rich object navigation and aggregation.
Given Data / Assumptions:
Concept / Approach:
OQL queries can return full collections (bags/lists) possibly with duplicates; they can also request duplicate-free results analogous to SQL DISTINCT. Predicates in WHERE clauses (select-from-where) enable returning subsets that match specified conditions.
Step-by-Step Solution:
Verification / Alternative check:
Canonical OQL syntax mirrors SQL capabilities, supporting all three behaviors depending on the query.
Why Other Options Are Wrong:
Each single option is valid but incomplete; only “All of the above” covers the full capability set.
Common Pitfalls:
Forgetting to use DISTINCT when semantics demand uniqueness; returning overly large collections without filtering.
Final Answer:
All of the above.
Discussion & Comments