How to design to avoid two-way reference between two tables I am having a problem with foreign keys between two tables. I am trying to model a relationship between members of a club and their relatives. This is a straightforward many-to-one relationship, with many relatives related to one member. However, one and just one of this relatives must be the main contact. Also, many members can have the same relative as main contact (siblings to their father as an example).

EDIT: Members are kids, and relatives must be adults, so relatives can't be members, and members can't be main contact of another member.

A FK on member table refering the PK of relatives would work, but this will leave me with a circular reference and a "chicken-or-egg" problem.

What is the right approach to this kind of problems? Maybe I am just thinking it too much.

Schema is more or less like this:


+--------------+    +-------------+
| member       |    | relatives   |
+--------------+    +-------------+
|id            |&lt;-+ |id           |&lt;-+
|name          |  +-|*member_id   |  |
|address       |    |name         |  |
|phone         |    |relationship |  |
|...           |    |phone        |  |
|*main_contact |-+  |...          |  |
+--------------+ |  +-------------+  |
                 +-------------------+
Sounds like you may need a self-join:


Get rid of the relatives table entirely
Define the main_contact as a foreign_key to the id column of the member table.


Or depending on the relationship a many-to-many resolver table in the middle:


Get rid of member_id from relatives 
Get rid of main_contact
from from member 
Add a new table member_relative with the
columns member_id, relative_id and a column to indicate
relationship_type.