database 分辨Candidate Key
时间:2013-11-17
来源:互联网
TEACHER (TeacherNo, TeacherNarne, Office, TeacherTel)
give a candidate key in TEACHER relation
我唔知点分Candidate Key
因为superkey 同 Candidate Key好似样 睇完wiki都系唔明
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 编辑 ]
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
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28