设为首页 加入收藏

TOP

11招教你如何玩转数据库设计 (11 Important Database designing rules)(六)
2012-04-13 14:36:15 来源:c-sharpcorner 作者:Shivprasad 【 】 浏览:43914次 评论:0

Rule 6:- Watch for partial dependencies

aa10.jpg

Watch for fields which are depending partially on primary keys. For instance in the above table we can see primary key is created on roll number and standard. Now watch the syllabus field closely. Syllabus field is associated with a standard and not with a student directly (roll number).

Syllabus is associated with the standard in which the student is studying and not directly with the student. So if tomorrow we want to update syllabus we have to update for each student which is pain staking and not logical. It makes more sense to move these fields out and associate them with the standard table.

You can see how we have move the syllabus field and attached the same to standards table.

This rule is nothing but second normal form "All keys should depend on the full primary key and not partially".
 

Rule 6:当心数据依赖

观察该领域中的部分列表。如图,我们创建了roll number和standard,可以看到教学科目紧密联系在一起,但与学生学习的科目没有直接关联。如果我们想给每位学生更新教学科目,这似乎看起来是不符合逻辑的,但是通过键入standard条目转换这些数据就可达到目的。

这个规则告诉我们“所有的键入都应该依赖主键”。All keys should depend on the full primary key and not partially。

Tags:数据库 设计 责任编辑:admin
首页 上一页 3 4 5 6 7 8 9 下一页 尾页 6/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇索引的原理及索引建立的注意事项 下一篇最新翻译书籍《SQL语言详解》出版

最新文章

热门文章

推荐文章

相关文章