Question
Consider the following statements and about the relational data model:
: A relation scheme can have at most one foreign key.
: A foreign key in a relation scheme cannot be used to refer to tuples of .
Which one of the following choices is correct?
Official answer and solution
- Official answer
- D
- From
- Official GATE 2021 answer key
Solution
Evaluate standard relational database definitions regarding foreign key constraints and self-referential relationships.
Statement states that a relation scheme can have at most one foreign key. This is false. A relation scheme can contain multiple foreign keys referencing candidate keys in different relations or the same relation (for instance, an Enrollment table referencing both Student and Course).
Statement states that a foreign key in a relation scheme cannot be used to refer to tuples of . This is also false. A foreign key can reference the primary key of its own relation, known as a self-referencing foreign key or recursive foreign key (for instance, an Employee table where attribute manager_id references emp_id of the same Employee table).
Therefore, both statements and are false, which corresponds to option D.
D
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2021 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 16 of 65, printed as CS Q.6
- 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.