what about super key or composit key?explain | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what about super key or composit key?explain

3rd Nov 2016, 4:57 PM
darshan bapodariya
darshan bapodariya - avatar
1 Answer
+ 2
Reference: http://stackoverflow.com/questions/24080915/difference-between-super-key-and-composite-key - Branko Dimitrijevic A superkey is any set of columns that, combined together, are unique. There are typically many superkeys per table and same column may be shared by many superkeys. They are not very useful by themselves, but are more of a mental tool for identifying candidate keys (see below). A candidate key is a minimal superkey - if any column is removed it would no longer be unique. There are typically significantly fewer candidate keys than superkeys. A key is just a synonym for a candidate key. A composite1 key is a key that has more than one column. In other words, it's a minimal superkey that has multiple columns. Few more points: Every key is unique, so calling it "unique key" is redundant. Just "key" is enough. At the DBMS level, a key is enforced through a PRIMARY KEY or UNIQUE2 constraint. An index is usually present underneath the key (PRIMARY KEY or UNIQUE constraint), for performance reasons. But despite often going together, key and index are separate concepts: key is a logical concept (changes the meaning of data) and index is a physical concept (doesn't change the meaning of data, just performance).
28th Nov 2016, 9:50 AM
ViceKnightTA
ViceKnightTA - avatar