Consider a relational database schema with a relation π
(π΄, π΅, πΆ, π·). If {π΄, π΅} and
{π΄, πΆ} are the only two candidate keys of the relation π
, then the number of superkeys
of relation π
is ______. (answer in integer)
We are given a relation \(R(A, B, C, D)\) whose only candidate keys are \(\{A, B\}\) and \(\{A, C\}\). The goal is to determine how many superkeys \(R\) has.
Think of it this way: a superkey is any attribute combination that is 'key enough', meaning it must fully contain at least one of the candidate keys. Since \(R\) has only 4 attributes total, there are \(2^4 = 16\) possible attribute combinations in total, but not all of them are superkeys -- only those that cover a candidate key.
Approach using the extra, non-key attributes:
Attribute \(D\) never appears in any candidate key, so \(D\) is what we call an 'extra' attribute -- it can be freely added to or left out of any superkey without affecting whether that set is minimal or not. Attribute \(A\) is common to both candidate keys, while \(B\) and \(C\) are the attributes that distinguish the two candidate keys from each other.
Now build the superkeys systematically. Any superkey must contain \(A\) together with either \(B\) or \(C\) (or possibly both), and it may or may not also contain \(D\).
Case 1: Superkey contains \(\{A, B\}\) but not \(C\). With \(D\) optional, this gives 2 combinations: \(\{A,B\}\) and \(\{A,B,D\}\).
Case 2: Superkey contains \(\{A, C\}\) but not \(B\). With \(D\) optional, this gives 2 combinations: \(\{A,C\}\) and \(\{A,C,D\}\).
Case 3: Superkey contains both \(\{A, B, C\}\) (covers both keys at once). With \(D\) optional, this gives 2 combinations: \(\{A,B,C\}\) and \(\{A,B,C,D\}\).
Adding these mutually exclusive cases: \(2 + 2 + 2 = 6\).
So the total number of superkeys of \(R\) is:
\[\boxed{6}\]
This matches the official answer range of 6 to 6.

Let π, π, π
and π be the attributes of a relation in a relational schema. Let π βΆπ
indicate functional dependency in the context of a relational database, where
π, π β{π, π, π
, π}.
Which of the following options is/are always true?