且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SQL:一个外键引用几个表之一中的主键

更新时间:2022-12-11 10:55:17

为什么不能设置NoteContentRelationship.ContentId为外键?您可以轻松地使用关系继承模型,其中表 Content 表示抽象基类,各种表 AnimalContentCarContent 等表示派生类.

Why is it impossible to set NoteContentRelationship.ContentId as a foreign key? You can easily use a relational inheritance model with a table Content representing an abstract base class, and various tables AnimalContent, CarContent, etc. representing derived classes.