Which data constraint specifies that values in a column must come from a defined, specific set (that is, only allowed values are permitted)?

Difficulty: Easy

Correct Answer: A domain constraint

Explanation:

Introduction / Context:Constraints enforce data quality by restricting what can be stored. Among them, domain constraints govern the permissible set of values at the attribute level.

Given Data / Assumptions:

  • We want to restrict a column to a particular allowed set (for example, status ∈ {'New', 'Open', 'Closed'}).
  • The constraint applies to the attribute's legal values.

Concept / Approach:A domain constraint defines the set of valid values for an attribute. It can be implemented with a CHECK constraint, an enumerated type, or a reference table with a foreign key. The key idea is that only listed or allowable values can exist in that column.

Step-by-Step Solution:

Recognize the requirement: whitelist of legal values.Map that to domain-level enforcement.Select “domain constraint”.

Verification / Alternative check:DBMS documentation often shows domain checks as CHECK (status IN (...)) or by referencing a domain table.

Why Other Options Are Wrong:Range constraint: Restricts by numeric/temporal range, not a discrete set. Intrarelation/Interrelation constraints: Describe constraints within or between tables generally; they do not specifically denote value-domain restrictions.

Common Pitfalls:Hard-coding value lists across application tiers instead of centralizing in the database; forgetting to validate during updates as well as inserts.

Final Answer:A domain constraint

More Questions from Data Models into Database Designs

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion