If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Relationships

If the database was well designed, the constraints will tell all. Consider 2 tables A and B:

optional one-to-one: B has a foreign key F to A and there is a unique constraint on the columns of F and the columns of F allow NULLs.

mandatory one-to-one: B has a foreign key F to A and there is a unique constraint on the columns of F and the columns of F do not allow NULLs.

optional one-to-many: B has a foreign key F to A and there is no unique constraint on the columns of F and the columns of F allow NULLs.

mandatory one-to-many: B has a foreign key F to A and there is no unique constraint on the columns of F and the columns of F do not allow NULLs.

A good CASE tool could reverse engineer the entity model from such a database.

If it was not well designed, you will have to infer the relationships from the data, and verify them with a knowledgeable user (e.g. "it appears that each FOO may have 0 or many BARs - is that correct?")