Search code examples
databasecandidate-key

Can i have more candidate keys than columns?


Is it possible to have more than n candidate keys in table of n columns? I know that i can have exactly n candidate keys f.e. in table where every piece of every record is different. But how about more candidate keys?


Solution

  • No.

    You can have compound keys. So if there are n simple keys then table can have 2^n - 1 superkeys. But since candidate key is minimal superkey, there can be only n candidate keys.