Integrity in SQL: Which statement about constraints is true?

Prepare for IT Operations Management exams. Use our extensive question bank and real-world scenarios to master the subject. Get ready for your ITOM exam with confidence!

Multiple Choice

Integrity in SQL: Which statement about constraints is true?

Explanation:
Check constraints enforce per-row logic, such as ensuring a numeric value falls within a permitted range. For example, a constraint like CHECK (age BETWEEN 0 AND 120) guarantees that any inserted or updated row has a valid age. This is why a range check is a valid use of a check constraint. Check constraints don’t perform cross-table validation; they evaluate only the values in the single row being modified, so they can’t enforce rules that depend on other rows or tables. Primary keys cannot be null; they are used to uniquely identify each row, so null values would violate that uniqueness. Foreign keys reference only columns that have a unique constraint (typically the primary key) in the referenced table, not arbitrary columns.

Check constraints enforce per-row logic, such as ensuring a numeric value falls within a permitted range. For example, a constraint like CHECK (age BETWEEN 0 AND 120) guarantees that any inserted or updated row has a valid age. This is why a range check is a valid use of a check constraint.

Check constraints don’t perform cross-table validation; they evaluate only the values in the single row being modified, so they can’t enforce rules that depend on other rows or tables.

Primary keys cannot be null; they are used to uniquely identify each row, so null values would violate that uniqueness.

Foreign keys reference only columns that have a unique constraint (typically the primary key) in the referenced table, not arbitrary columns.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy