What's the point of a candidate key?

前端 未结 9 623
借酒劲吻你
借酒劲吻你 2020-12-09 18:00

I\'m fairly new to database management and this question never seems to be answered in more than one sentence. All other SO answers say \"A candidate key is a minimal super

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 18:34

    We use candidate key, because some times it is necessary to take care of the record and other issue, for example a data base for bank system, where Account_No is primary key and SocialSecurity_NO will be candidate key, we keep the SocialSecurity_NO as UNIQUE key, because if government got a mistake in providing the SocialSecurity_NO, then it will be big problem, so we have already declared it as UNIQUE key, so there is no possibility that two user with same SocialSecurity_NO will be able for account...

    primary key----------- candidate key---------attribute3-------attribute4

    Account_No SocialSecurity_NO

提交回复
热议问题