设为首页 加入收藏

TOP

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

Rule 5:- Watch for data separated by separators.

The second rule of 1st normal form says avoid repeating groups. One of the examples of repeating groups is explained in the below diagram. If you see the syllabus field closely, in one field we have too much data stuffed.These kinds of fields are termed as "Repeating groups". If we have to manipulate this data, the query would be complex and also I doubt performance of the queries.

a8.jpg

These kinds of columns which have data stuffed with separator's need special attention and a better approach would be to move that field to a different table and link the same with keys for better management.

aa9.jpg

So now let's apply the second rule of 1st normal form "Avoid repeating groups". You can see in the above figure I have created a separate syllabus table and then made a many-to-many relationship with the subject table.

With this approach the syllabus field in the main table is no more repeating and having data separators.
 

Rule 5:注意被分隔符分割的数据

前面的规则2即“第一范式”提到避免数组重复,如图所示。如果你看到教学大纲紧密排列在一起,这个领域中需要很多数据来填充,这种我们称之为“重复数组”。如果我们必须操纵这些数据,单凭查询是很困难的,我甚至还怀疑是否具备这个查询功能。

这些带分隔符的数据需要特别注意,如何利用更好的方法将这些数据移动到一个不同的任务栏中,以便更好的分类呢?如图:

如图所示,可以看到我创建了一个独立的教学科目条目,然后列出了与之有相关联的科目。这种方法主要适用于在教学大纲领域,避免过多的重复和数据分隔符中。

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

最新文章

热门文章

推荐文章

相关文章