Difficulty: Easy
Correct Answer: To define a range for an attribute.
Explanation:
Introduction / Context:
Enumerated types (enum) restrict a value to one of a fixed set of symbolic constants. In object-oriented data models and ODL-like DDLs, enums are commonly used to constrain attribute domains (e.g., status ∈ {Pending, Approved, Rejected}).
Given Data / Assumptions:
Concept / Approach:
An enum defines an attribute domain. After declaring the enum, attributes may use that type so stored values are validated against the allowed literals. Classes and relationships are not “ranged” by enums; they define structure and links, not constrained atomic values.
Step-by-Step Solution:
Verification / Alternative check:
Schema examples show enum declarations used as attribute types (e.g., attribute Status status;), never as class or relationship ranges.
Why Other Options Are Wrong:
Class: structural definition; not a finite literal domain.
Relationship: links objects; not an atomic literal type.
All of the above: too broad; only attribute domains fit.
Common Pitfalls:
Encoding enums as free-text strings without validation; mixing display labels with stored enum identifiers.
Final Answer:
To define a range for an attribute.
Discussion & Comments