WebAnswer (1 of 7): It is logically right in database management and in fact possible and must be allowed by any RDBMS to reference a foreign key to two or more tables that wants … WebIn order to create a link between two tables, we must specify a Foreign Key in one table that references a column in another table. That means Foreign Key constraint is used …
sql server - Foreign Key to multiple tables - Stack Overflow
WebMake the primary key id, a unique key on (id,type), the child tables' foreign key be on (id, type), and put a CHECK constraint on each child table to only have the correct type. Or, … WebDec 13, 2024 · A declared foreign key (i.e., one enforced by the database engine) cannot tie to multiple other tables. So id_device in group_device cannot be a foreign key to all … key stakeholders for maternal health
Can a foreign key reference multiple tables? - Stack …
WebThe FOREIGN KEY constraint is a key used to link two tables together. A FOREIGN KEY is a field (or collection of fields) in one table that refers to the PRIMARY KEY in another … WebFeb 13, 2014 · GilaMonster (2/12/2014) Yup, perfectly possible. It's not one foreign key though, it's two foreign keys, one referencing each of the tables. CREATE TABLE … WebApr 10, 2024 · I have seen the proposed solution Defining multiple foreign keys in one table to many tables but it is too convoluted. It would create a table Photos with just a PK and a name and tables like: photos_shoes table, the PK of Photos and an FK that links to the PK of Photos photos_trousers table,the PK of Photos and an FK that links to the PK … key stage two sats access arrangements