Suppose and are two relation schemas. Let and be the corresponding relation instances. is a foreign key that refers to in . If data in and satisfy referential integrity constraints, which of the following is ALWAYS TRUE?
View worked solution
Answer: A
By definition, a referential integrity constraint ensures that every value of a foreign key in a referencing relation must exist in the primary key of the referenced relation.
Here, is a foreign key in that refers to the primary key in . Therefore, every value of present in the instance must also be present in the column of the instance .
In terms of relational algebra, this subset relationship is expressed as:
Using set theory, if , then the set difference is empty (). Substituting our projections:
Hence, Option A is always true.
Analysis of other options:
- Option B: is only true if every primary key value in is referenced by some tuple in . This is not mandatory.
- Option C: is a special case of Option B and is not always true.
- Option D: represents a violation of referential integrity (where a foreign key value exists in but not in ).
Free practice · Your answers on this page are not saved.
