Foreign keys?

R

r_shawn

Is it okay to have 3 foreign keys in a table? B/c I have 4 tables and I
wanted to be able to connect them for their relationships, so I just
put their primary key in every table. Please help me.

Thanks,
Robin
 
V

Van T. Dinh

The answer is yes but that's NOT the correct way of establishing
relationships.

You need to define clearly the entitites in your database and how they are
related to each other. There are 3 different types of relationship:
One-to-One, One-to-Many (including the reverse Many-to-One) and
Many-to-Many. Where you place the ForeignKey depends on the type of
relationship you need for different entities in your database.
 
Top