4 ms·
You don't need a FK to point to multiple tables. You would have the reference in the other direction, from multiple different tables to one table.
by goto11 5y ago
You don't need a FK to point to multiple tables. You would have the reference in the other direction, from multiple different tables to one table.
- ithkuil 5y agoHow do you ensure that only one row of only one table references the row of that one table?
- alexvoda 5y agoTheoretically, this could also be achived by allowing FKs to Views. But I know of no system that allows this.
- goto11 5y agoMost databases have weak support for cross-table constraints. I believe in SQL Server you can define an indexed view on the union of the tables and then apply a unique constraint on the foreign key.