If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Conceptual ques on keys

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-30-08, 02:19
lenovo lenovo is offline
Registered User
 
Join Date: Sep 2008
Posts: 2
Conceptual ques on keys

Please help me with this question :

Consider a relation R (A, B, C, D, E). The only information that you know about R is that ABC and CD are keys. List all possible keys (some will not be compatible with others).

Thanks
Reply With Quote
  #2 (permalink)  
Old 09-30-08, 11:35
dportas dportas is offline
Registered User
 
Join Date: Dec 2007
Location: London, UK
Posts: 732
Quote:
Originally Posted by lenovo
Please help me with this question :

Consider a relation R (A, B, C, D, E). The only information that you know about R is that ABC and CD are keys. List all possible keys (some will not be compatible with others).

Thanks
My guess is that "key" in this context means "super key" because that's the only way I can make sense of what's being asked. If what you quoted is verbatim then I suggest you read "key" as "super key". Does that help?
Reply With Quote
  #3 (permalink)  
Old 09-30-08, 12:41
lenovo lenovo is offline
Registered User
 
Join Date: Sep 2008
Posts: 2
Thanks for replying ........ This is one answer I got on internet.........but could not understand. But then I think my question will be solved on these lines ...............


Consider a relation R(A,B,C,D,E,F). The only thing you know about R is that ABCD and
EF are keys. What is the maximum number of keys that R can possibly have (including ABCD and
EF)? Explain your calculation.
Since ABCD and EF are keys, no subset or superset can be a key (recall that a key is
minimal). The largest number of keys can be found by add an E or an F to selected subsets
of ABCD. The largest number of subsets of ABCD are of length 2, i.e., ¡4
2¢ = 6 (namely, AB,
AC, AD, BC, BD, CD). To these we can add either an E or an F to obtain a new key. So the
total number of keys that are not sub/supersets of ABCD or EF are 12 (namely, ABE, ABF,
ACE, ACF, ADE, ADF, BCE, BCF, BDE, BDF, CDE, CDF). Adding the two original keys,we have a maximum of 14 possible keys for the relation.



Any suggestion for mine?
Reply With Quote
  #4 (permalink)  
Old 09-30-08, 14:44
dportas dportas is offline
Registered User
 
Join Date: Dec 2007
Location: London, UK
Posts: 732
The answer you gave assumes that "key" means "candidate key", ie a minimal set. That is the usual meaning of "key" and may have been the intention of the question. I interpreted the question as "super key" only because it seemed like a more useful exercise but perhaps I was trying to be too clever.

Possibly you could impress your teacher by suggesting both interpretations. I've no intention of doing your homework for you though.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On