Question
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?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2012 answer key
Solution
Apply the relational definition of foreign keys and referential integrity constraints.
-
Let in relation be a foreign key referencing primary key in relation .
-
The referential integrity constraint requires that for every tuple in , the foreign key value in must either be NULL or match an existing value in attribute of .
-
In terms of relation instances (assuming non-null foreign key values as modeled in relational algebra):
- In set algebra, set is a subset of set () if and only if the difference is empty:
- Thus, statement (A) is ALWAYS TRUE.
A
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2012 Computer Science and Information Technology (CS)
- Question
- 43 of 65, printed as CS Q.43
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.