Column/domain ➔ protects attribute values (the domain).
⚙️ Core Implementation
🔹 The three rules as DDL
constraint DDL
studentID NUMBER PRIMARY KEY, -- entity: unique + NOT NULLstudent_id NUMBER REFERENCES STUDENT, -- referential: match PK or NULLage NUMBER(3) CHECK (age BETWEEN 0 AND 120) -- column/domain
💡 Common Mistake:Entity integrity ⟹ usable PK ➔ a NULL PK can’t identify a tuple, a duplicate PK makes two tuples indistinguishable (Relation Properties); NULL FKs are allowed (optional participation).
⚖️ Core Decision Matrix
Rule
Guards
Constraint
entity
tuple identity
PK unique + non-NULL
referential
relationships
FK matches PK or NULL
column/domain
attribute values
one domain per attribute
When It Flips: constraints are part of the schema, so the DBMS rejects any insert/update/delete that would violate them — no per-operation application code. Referential integrity constrains deletes (block or cascade). NULL allowances are SQL/RDBMS features (classical algebra has none).
📊 Exam Execution Trace
Manual Execution Trace
Checking each rule:
Step / State
Rule
Example violation
0 (Init)
—
—
1
entity
NULL/duplicate studentID
2
referential
ENROLMENT.student_id with no STUDENT
3
column
Age = “twenty”
Applied Exercise
Problem: Why does entity integrity forbid a NULL or duplicate primary key?
Derivation Proof / Hand-Calculation Walkthrough: