Can a foreign key reference more than one table?

0

I would like to know if it is possible for a foreign key to reference more than one table, for example:

customer table
PK - client code
- client name

official table
PK - employee code
- employee name

contact table - phone
- Email
FK - contact code, customer table reference (client code), employee table reference (employee code)

    
asked by anonymous 08.03.2014 / 18:38

1 answer

3

A foreign key can not reference more than one table; in fact, this would go against the principles of the data logic modeling itself.

The most correct way to relate the tables in the example mentioned would be:

Client table:

  • PK client code

  • FK contact code (reference to contact table)

  • client name

Official table:

  • PK employee code

  • FK contact code (reference to contact table)

  • employee name

Contact table:

  • PK contact code
  • phone
  • e-mail
09.03.2014 / 02:58