Which constraint enforces value rules such as minimum, maximum, or a specified set of values?

Prepare for your Database Systems Test. Use flashcards and multiple-choice questions, each question with hints and explanations. Ace your exam!

Multiple Choice

Which constraint enforces value rules such as minimum, maximum, or a specified set of values?

Explanation:
A check constraint enforces value rules by evaluating a condition on the data in a column for every row. This is how you express minimum or maximum limits or membership in a specific set, such as CHECK (age >= 0 AND age <= 120) or CHECK (status IN ('active','inactive','pending')). When a row is inserted or updated, the database checks that the condition is true; if not, the operation is rejected. By contrast, a unique constraint ensures all values in a column are distinct, a not null constraint requires a value to be present (not NULL), and a primary key constraint combines uniqueness with not null to identify each row.

A check constraint enforces value rules by evaluating a condition on the data in a column for every row. This is how you express minimum or maximum limits or membership in a specific set, such as CHECK (age >= 0 AND age <= 120) or CHECK (status IN ('active','inactive','pending')). When a row is inserted or updated, the database checks that the condition is true; if not, the operation is rejected. By contrast, a unique constraint ensures all values in a column are distinct, a not null constraint requires a value to be present (not NULL), and a primary key constraint combines uniqueness with not null to identify each row.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy