The student marks should not be greater than 100. This is
2013
The student marks should not be greater than 100. This is
- A.
Integrity constraint
- B.
Referential constraint
- C.
Over-defined constraint
- D.
Feasible constraint
Attempted by 1493 students.
Show answer & explanation
Correct answer: A
Answer: Integrity constraint
Explanation:
Integrity constraints enforce valid data values or domains for attributes. The rule that student marks should not be greater than 100 is a value/domain integrity constraint.
Common ways to implement this in a database include a CHECK constraint or defining a suitable domain/data type that limits the allowed range.
Referential constraints (foreign keys) enforce relationships between tables and do not limit numeric ranges; other listed terms are not the correct database constraint for this rule.
Example (SQL):
ALTER TABLE Students ADD CONSTRAINT chk_marks CHECK (marks <= 100);
Or define the column with a constrained domain or numeric type and validate input in the application layer as needed.
A video solution is available for this question — log in and enroll to watch it.