Multiple foreign keys to a single column

后端 未结 7 2226
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 16:41

I\'m defining a database for a customer/ order system where there are two highly distinct types of customers. Because they are so different having a single customer table wo

相关标签:
7条回答
  • 2020-12-14 17:36

    You can create a foreign key referencing multiple tables. This feature is to allow vertical partioining of your table and still maintain referential integrity. In your case however, this is not applicable.

    Your best bet would be to have a CustomerType table with possible columns - CustomerTypeID, CustomerID, where CustomerID is the PK and then refernce your OrderID table to CustomerID.

    Raj

    0 讨论(0)
提交回复
热议问题