数据库规范化 [英] Database Normalization

查看:162
本文介绍了数据库规范化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是数据库设计的新手,我已经阅读了很多关于规范化。如果我有三个表:住宿,火车站和机场。我在每个表中有地址列或其他表引用的地址表?是否有过度规范化的问题?

I'm new to database design and I have been reading quite a bit about normalization. If I had three tables: Accommodation, Train Stations and Airports. Would I have address columns in each table or an address table that is referenced by the other tables? Is there such a thing as over-normalization?

感谢

推荐答案

数据库规范化是关于构建关系(表),维护关系(表)中的事实(列)和构成模式的数据库(表)之间某些功能的
依赖
)。

Database Normalization is all about constructing relations (tables) that maintain certain functional dependencies among the facts (columns) within the relation (table) and among the various relations (tables) making up the schema (database). Bit of a mouth-full, but that is what it is all about.


是关于数据库理论的经典参考正常形式。本文简单定义每个正常形式的本质是
及其对数据库表设计的意义。这是一个非常好的触摸式参考。

A Simple Guide to Five Normal Forms in Relational Database Theory is the classic reference for normal forms. This paper defines in simple terms what the essence of each normal form is and its significance with respect to database table design. This is a very good "touch-stone" reference.

要正确回答您的具体问题需要更多信息。您必须询问
的一些关键问题是:

To answer your specific question properly requires additional information. Some critical questions you have to ask are:


  • 地址是一个简单的事实事实(例如
    由多个属性组成:地址行,城市名称,邮政编码等)

  • 与住宿相关的其他事实是什么,
    机场和火车站?

  • 什么集合的事实唯一且最低限度地标识机场,住宿
    和火车站(这些事实通常称为密钥或候选

这一切都说,你的问题的答案不像你所期望的那么简单!

All this to say, the answer to your question is not as straight forward as one might hope for!

有没有过度规范化的东西?也许。这取决于您确定并用于构建表的
函数依赖关系是否为
对您的应用程序域有重要意义。

Is there such a thing as "over normalization"? Maybe. This depends on whether the functional dependencies you have identified and used to build your tables are of significance to your application domain.

例如,假设确定地址
由多个属性组成;其中之一是邮政编码。技术上,邮政
代码也是一个复合项目(至少是加拿大邮政编码)。进一步规范你的
数据库来识别这些事实可能是一个过度规范化。这是因为
邮政编码的组件与您的应用程序不相关,因此将
纳入数据库设计将是一个过度规范化。

For example, suppose it was determined that an address was composed of multiple attributes; one of which is postal code. Technically a postal code is a composite item too (at least Canadian Postal Codes are). Further normalizing your database to recognize these facts would probably be an over-normalization. This is because the components of a postal code are irrelevant to your application and therefore factoring them into the database design would be an over-normalization.

这篇关于数据库规范化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆