Bidirectional foreign key constraint

前端 未结 6 1273
时光说笑
时光说笑 2020-12-19 07:33

I\'m thinking of designing a database schema similar to the following:

Person (
  PersonID int primary key,
  PrimaryAddressID int not null,
  ...
)

Address         


        
6条回答
  •  情话喂你
    2020-12-19 08:15

    From your design, it seems that an address can apply to only one person, so just use the PersonID as the key to the address table, and drop the AddressID key field.

提交回复
热议问题