in Databases retagged by
296 views
0 votes
0 votes

Please explain   

Ans is 22

in Databases retagged by
296 views

3 Comments

getting 10.
0
0

@Amit Mehta  

source of the question?

0
0

@Chandrabhan Vishwa 1 Looks like Geeksforgeeks

0
0

1 Answer

1 vote
1 vote
Best answer
Total Keys Possible = $2^5$ = 32

Candidate Key is Minimal Super Key. There can be multiple CK’s.

We select any one key of our choice from CK’s and call it as primary key of the table.

Candidate Keys:

CITY => not possible (As CITY,COUNTRY is a candidate key already)

COUNTRY => not possible(same reason)

Anything added with CITY,COUNTRY is also not possible as we want minimal superkey. Here, we have 8 possibilities.

Possible Candidate Keys = $32 – 2 – 8 = 22$
selected by

13 Comments

Nice approach
0
0
edited by
This answer is wrong (poor question + Wrong solution). Worst thing .

 {state}, {state,pincode} both together you are taking as candidate key,
0
0

@raja11sep why u take state and state pincode simultaneously?

0
0
Bro read the ans and my comment again. I’m just giving counter-example.
0
0
@raja

why u take both values simultaneously this is a possibility  means these are not simultaneoulsy hold  in a relation . like when u toss a coin   then it is head or tail not both

at a time only one
0
0

@raja11sep Also once they counted {name}, {state}, {pincode} as candidate key, how can they count superset of these as candidate keys?

0
0
This question is so badly framed, it should not even exist.
0
0

@Aditya_ exactly bro. 

0
0
They are the total candidate keys possible. Need not hold all conditions simultaneously.
0
0
Still, the first statement of the best answer is wrong.
0
0
I guess the total number of keys possible would be 31. From the formula $2^{^{n}}-1$ for the total number of superkeys possible with $n$ attributes.
1
1
yes
0
0

@Vishal_kumar98 

subtracting 8 manage it

0
0