【发布时间】:2010-11-29 13:11:09
【问题描述】:
可能的重复:
Is there common street addresses database design for all addresses of the world?
What is the “best” way to store international addresses in a database?
Best practices for consistent and comprehensive address storage in a database
我目前有四个表,客户、联系人、设施和客户。
每个表都有以下字段: AddressLine1, AddressLine2, City, StateOrProvince, PostalCode。
我想将地址移到单独的表格中,并且还可以指定地址类型(帐单、送货、主要等)。
我的解决方法如下:
- 从客户、联系人、设施和客户中删除 AddressLine1、AddressLine2、City、StateOrProvince、PostalCode。
- 使用 AddressID(PK)、AddressLine1、AddressLine2、City、StateOrProvince、PostalCode、LastUpdateUser、LastUpdateTime 字段创建 Addresses 表。
- 创建包含 AddressTypeID、AddressTypeName、AddressTypeDescription、AddressTypeActive、LastUpdateUser、LastUpdateTime 字段的 AddressTypes 表
- 创建包含字段 CustomerID、AddressID、AddressTypeID、CustomerAddressActive、LastUpdateUser、LastUpdateTime 的 CustomerAddresses 表
- 创建包含字段 ClientID、AddressID、AddressTypeID、ClientAddressActive、LastUpdateUser、LastUpdateTime 的 ClientAddresses 表
- 创建包含字段 ContactID、AddressID、AddressTypeID、ContactAddressActive、LastUpdateUser、LastUpdateTime 的 ContactAddresses 表
- 创建包含字段 FacilityID、AddressID、AddressTypeID、FacilityAddressActive、LastUpdateUser、LastUpdateTime 的 FacilityAddresses 表
我正在寻找指导以确定是否有比我设计的解决方案更好的解决方案。为什么大家都这么想?
编辑:此时我不关心美国以外的任何事情,也不关心如何存储街道地址,即街道编号与整个街道地址。我是从数据库设计和表结构的角度来考虑的。
【问题讨论】:
-
拥有多个地址表有什么问题?
标签: database-design data-modeling