1

Is it possible for a foreign key to reference several tables?

If not, how can we achieve one table linking to several others if not using the foreign key?

If yes, how?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • A single foreign key can only reference two tables. However, You can specify multiple foreign keys between multiple tables. – Zohar Peled Jun 19 '16 at 12:24
  • Possible duplicate of [Foreign Key to multiple tables](http://stackoverflow.com/questions/7844460/foreign-key-to-multiple-tables) – Liam Oct 06 '16 at 08:56

3 Answers3

-1

You can declare as foreign keys as you need every one for one table

Plebios
  • 835
  • 1
  • 7
  • 17
-1

I'm not sure that I understand your question but if you mean two tables will reference a third table it is possible but if you mean connection of many to many between tables then you will have create another table which will hold both foreign keys.

Pini Cheyni
  • 5,073
  • 2
  • 40
  • 58
-1

You can always link any two tables through a join in a query, provided you can devise some boolean expression which defines the relationship.

Kevin Anderson
  • 4,568
  • 3
  • 13
  • 21