Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
what is the Difference between key and super key .. i heared that both are same .. if so then why they are given two names like one boy have two name chintoo and pappu types
Posted

1 solution

Well, your question is quite vague, since if you speak about superkey, you can't just tell "key": there are key candidates, primary keys, foreign keys and so on... This is a topic that is addressed by all tutorials dealing with the relational model theory. You will need some level of linear algebra theory to understand relational algebra, and to really see the points.
What have you tried to find the answer? Oh... you posted a question here. But what about using google for example? And oh, by the way, wikipedia's article in this topic is quite good:
http://en.wikipedia.org/wiki/Superkey[^]... and don't forget to follow the links in the See also section.
But this is also quite good:
Quote:
A superkey is a set of columns that uniquely identifies every row in a table, while a key is a minimal set of such columns.
See: http://my.safaribooksonline.com/book/databases/9788131700785/3dot6-keys/navpoint107[^]
 
Share this answer
 
Comments
Member 10333615 13-Oct-13 16:48pm    
i think minimal superkey is candidate key because candidate key are those superkeys whose non null proper subset is not a super key


As per my knowledge of relational algebra i think "super key and key are same thing" .. candidate key is different , primary key is different , foreign key is different
Zoltán Zörgő 13-Oct-13 16:53pm    
You have used this terminology. There is no "just key". Yes, the minimal superkeys are all key candidates. And the primary key is the one you elect from them based on other considerations.
Member 10333615 13-Oct-13 16:56pm    
okz so nothing is there like key?? there is just super key from which we select candidate key and primary key foreign key etc
Zoltán Zörgő 13-Oct-13 17:00pm    
More or less. Superkey, candidates are terminologies defined in the theory. Among others. It is a matter of attribute dependency. In practice, these are rarely used. Developers will most likely talk only about primary keys and foreign keys.
Member 10333615 13-Oct-13 17:04pm    
k fine .. but we can say that all these superkey, Foreign key, candidate key, primary key comes under key in DBMS..i mean to say that key in DBMS is sub categorized as superkey, Foreign key, candidate key, primary key

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900