Foreign key to one of many tables?

No, a foreign key constraint always references exactly one parent table.

This question comes up frequently. Here are some of my past answers to it:

For more on Polymorphic Associations, see my presentation Practical Object-Oriented Models in SQL or my book, SQL Antipatterns, Volume 1: Avoiding the Pitfalls of Database Programming.

Leave a Comment