in Databases
11,391 views
34 votes
34 votes
The maximum number of superkeys for the relation schema $R(E,F,G,H)$ with $E$ as the key is _____.
in Databases
11.4k views

4 Comments

E __  __  __

For other attributes, there are two choices. So, $2^3=8$
4
4
instead of maximum it should be total  ( not min or max)
0
0

This is my Solution

1
1

8 Answers

59 votes
59 votes
Best answer

Super Key is any set of attributes that uniquely determines a tuple in a relation.

Since $E$ is the only key, $E$ should be present in any super key.

Excluding $E$, there are three attributes in the relation, namely $F, G , H$. Hence, if we add $E$ to any subset of those three attributes, then the resulting set is a super key. Number of subsets of $\{F, G, H\}$ is $8$. Hence the answer is $8$.

The following are Super Keys: $$\left \{ \substack{E\\EF\\EG\\EH\\EFG\\EFH\\EGH\\EFGH} \right \}$$

selected by

4 Comments

What if the question asked the max no. of superkeys possible for the schema R(E,F,H,G) without specifying anything about E?
0
0
When any specification about E is not given, possible superkeys are $2^{4} - 1$(possibility where we don't pick any of {E,F,G,H} as that’s not possible).
0
0
But the question doesn't say so, does it?

Maximum number of super keys should be 15.(in the case that E,F,G,H are all keys).
0
0
29 votes
29 votes
total number of super keys = $E$ has to be included it is must $\times$ for each attribute we have $2$ choices include it or don't

$\text{Total number of Super keys } = 1 \times 2 \times 2 \times 2 = 8$
11 votes
11 votes

E is the key so E must be included for the rest 3 we can take 0 or 1 or 2 or 3 so 3C0+3C1+3C2+3C3=1+3+3+1=8

10 votes
10 votes

Maximum no. of possible superkeys for a table with n attributes = 2^(n-1) Here, n = 4. So, the possible superkeys = 24-1 = 8 The possible superkeys are : E, EH, EG, EF, EGH, EFH, EFG, EFGH

3 Comments

@amarVashishth @Shaik Masthan

Sir,

what this formula says i didn't get it:

Maximum no. of possible superkeys for a table with n attributes = 2^(n-1) 

what i know or i can drive ,let say there are 4 attribute for a relation R is 

{E, F, G, H} (note that  i do not give any restriction here)

the possible number of super keys

include only one attribute -> 4C1 = 4.  => {E, F, G, H}

including two attribute 4C2 = 6. => {EF, EG, EH, FG, FH, GH}

including three and four 4C3 = 4 and 4C4 = 1. => { EFG, EGH, EFH, FGH} and {EFGH}

total possible SK's turns out to be = 15 so we can say ( 2^n) -1 where n-> #of attributes in the Relation R,

since they said clearly all super keys those includes E (E already a key in R)

 then we takes all super keys those includes E isn't it ?

and it is also possible that without including key attribute we can also form super keys

eventually  $\LARGE keys\subseteq candidate_keys \subseteq super_keys$

Correct me sir if i'm wrong, for correctness of my approach !

0
0
can you tell why E is also included in the count of super keys acutely E is not a Super key it is a Key right...
0
0

@sukesh_reddy Yes, you are right. E is a Key, but a key is also a super key.

0
0
Answer:

Related questions