Difficulty: Easy
Correct Answer: Data constraints
Explanation:
Introduction / Context:
Relational databases can enforce business rules at the schema level. A common rule compares values across columns within the same row (for example, a discount cannot exceed the total).
Given Data / Assumptions:
Concept / Approach:
Data constraints, typically a CHECK constraint, let you express rules such as discount_amount < total_amount. Data type defines format, null status controls presence, and default value provides a fallback value—none of those compare two columns.
Step-by-Step Solution:
Verification / Alternative check:
DBMS DDL shows CHECK constraints evaluating boolean expressions per row during INSERT/UPDATE.
Why Other Options Are Wrong:
Null status/Data type/Default value: None can enforce cross-column comparison by themselves.
Common Pitfalls:
Forgetting to consider NULL semantics (for example, when either column is NULL, the CHECK may evaluate to unknown and pass/fail depending on DBMS). Require NOT NULL if appropriate.
Final Answer:
Data constraints
Discussion & Comments