Which of the following statements is FALSE about keys in a relational database?
a. Any candidate key is eligible to become a primary key.
b. A primary key uniquely identifies the tuples in a relation.
c. A candidate key that is not a primary key is a foreign key.
d. A foreign key is an attribute whose value is derived from the primary key of another relation.
Answer
Answer by student:
c. A candidate key that is not a primary key is a foreign key.
Detailed answer by teachoo:
A key is an attribute or a set of attributes that can uniquely identify a tuple in a relation. There are different types of keys in a relational database, such as candidate key, primary key, and foreign key.
- A candidate key is a minimal set of attributes that can uniquely identify a tuple in a relation. There can be more than one candidate key for a relation, but each candidate key must be unique and irreducible.
- A primary key is one of the candidate keys that is chosen by the database designer to identify the tuples in a relation. A primary key must be unique, not null, and minimal.
- A foreign key is an attribute or a set of attributes in one relation that refers to the primary key of another relation. A foreign key establishes a link between two relations and enforces referential integrity.
Based on these definitions, we can analyze the given statements and find out which one is false.
- Statement a: Any candidate key is eligible to become a primary key. This statement is true , because any candidate key can be chosen as the primary key by the database designer, as long as it satisfies the properties of a primary key.
- Statement b: A primary key uniquely identifies the tuples in a relation. This statement is true , because this is the main purpose of a primary key.
- Statement c: A candidate key that is not a primary key is a foreign key. This statement is false , because a candidate key that is not a primary key is still a candidate key, and it does not necessarily refer to the primary key of another relation. A foreign key can be any attribute or set of attributes that matches the primary key of another relation, not just a candidate key.
- Statement d: A foreign key is an attribute whose value is derived from the primary key of another relation. This statement is true , because this is how a foreign key establishes a link between two relations.
So, the correct answer is c. A candidate key that is not a primary key is a foreign key.