+ -
当前位置:首页 → 问答吧 → database 分辨Candidate Key

database 分辨Candidate Key

时间:2013-11-17

来源:互联网

TEACHER (TeacherNo, TeacherNarne, Office, TeacherTel)
give a candidate key in TEACHER relation
我唔知点分Candidate Key
因为superkey 同 Candidate Key好似样 睇完wiki都系唔明

作者: yob664   发布时间: 2013-11-17

Superkey is referring "any" combination of the fields in table to form the uniqueness.
While "Candidate key" is the "least" combination of the fields in table to form the uniqueness.

The wiki is focus on explaining the combination which maybe confusing.
You can read this explanation:
http://rdbms.opengrass.net/2_Database%20Design/2.1_TermsOfReference/2.1.2_Keys.html

The major usage of candidate key is its uniqueness but not in sequence. Say for bank account or other sensitive personal data table, "primary key" provide uniqueness but it gives a chance for hacker to guess next record from its sequencing nature.

in your example, candidate key can be:
1. TeacherNo + TecherName
2. TeacherName + Office
3. TeacherName + TechcherTel4. TeacherNo
All these combination of fields can form a uniqueness key with least data fields.

[ 本帖最后由 wwodin 於 2013-9-23 08:22 PM 编辑 ]

作者: wwodin   发布时间: 2013-11-18

热门下载

更多