地址的数据库设计 [英] Database design for addresses

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

问题描述

我正在设计一个数据库,其中包含所有地址数据的供应商,客户,用户,客户站点等信息。我选择使用三个标准地址行,城市/城市,县和邮政编码字段。

I'm designing a database that holds information on suppliers, clients, users, client sites etc that all have address data. I have elected to use three standard address lines, town/city, county and postcode fields.

我的问题是,最好在所有表中有这些字段需要他们或有一个地址表,只需将地址id链接到relavent表?

My question is, would it be better to have these fields in all the tables that require them or have a address table and just link the address id to the relavent table?

很感谢

Gavin。

推荐答案

如果多个字段可能具有相同的地址, 。这有助于防止插入/更新异常,等等。如果每个地址都是唯一的,那可能不那么重要。

If it's possible for multiple fields to have the same address, I'd put the addresses in their own table. This helps prevent insertion/update anomalies, among other things. If every address is unique, it might not be that important.

一般来说,经验法则是永不重复数据。因此,如果多个行具有相同的值,那么这些值可能会移动到自己的表中。

In general, a rule of thumb is "never repeat data". So, if multiple rows have the same values, there's a chance those values can be moved into their own table.

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

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