tags:

views:

10

answers:

1

What is the difference between linking two tables and then the PK is an FK in the other table, but the FK has not got the primary key option (so it does not have the gold key),

and having the PK in one table as a PK in another table?

Am I right to think that the second option is for a many-to-many relationship?

Thanks

A: 

FK means that any value in our table should be present in the foreign table.

Since the column in the foreign table should be declared as a PK or a UNIQUE key, this means it can be present only once in the foreign table.

PK means that any value in our table should be present only once.

Combined together, they mean that any value should be present only once both in our table and in foreign table.

This is a (0-1):1 relationship.

Quassnoi