A prime attribute of a relation scheme \(R\) is an attribute that appears
2014
A prime attribute of a relation scheme \(R\) is an attribute that appears
- A.
in all candidate keys of
\(R\). - B.
in some candidate key of
\(R\). - C.
in a foreign key of
\(R\). - D.
only in the primary key of
\(R\).
Attempted by 616 students.
Show answer & explanation
Correct answer: B
Concept: A candidate key of a relation R is a minimal set of attributes that uniquely identifies every tuple of R; a relation can have more than one candidate key. An attribute is called a prime attribute if it belongs to at least one of R's candidate keys — membership in any single candidate key is enough. An attribute belonging to none of R's candidate keys is called non-prime.
Example: Let R(A, B, C, D) have two candidate keys, {A, B} and {A, C}. A appears in both; B appears only in the first; C appears only in the second. All three — A, B, and C — are still prime, because each appears in at least one candidate key. D appears in neither candidate key, so D is non-prime.
Why the other statements do not define a prime attribute:
"In all candidate keys of R" is too strong — in the example above, B sits in {A, B} but not in {A, C}, so requiring membership in every candidate key would wrongly mark B (and C) as non-prime. If R had two candidate keys sharing no attribute at all, this reading would leave zero prime attributes, which is not how the definition works.
"In a foreign key of R" confuses two unrelated ideas — a foreign key references a candidate key of another relation and enforces referential integrity; it has no bearing on whether an attribute sits inside one of R's own candidate keys.
"Only in the primary key of R" is too narrow — the primary key is just the one candidate key a designer picks to enforce as the identifier. An attribute in a different, unchosen candidate key is still prime even though it is absent from the primary key.
Result: So the defining condition is membership in some — at least one — candidate key of R, which matches the correct option.