Relationship in a Horse Progeny Table

B

Brad Kimbrell

I need to set up a database that will have what seems to be an unending
trail. I have a horse table that represents all horses. I also have a
progeny table that lists the horse and then the sire and dam of that
horse. Those sires and dams have other sires and dams which have sires
and dams and so on.

How do I set up the relationships for this database?

I also have some lookup tables that describe sex, color, etc. Do I
need to include these tables in the relationships diagram?
 
T

Tom Lake

Brad Kimbrell said:
I need to set up a database that will have what seems to be an unending
trail. I have a horse table that represents all horses. I also have a
progeny table that lists the horse and then the sire and dam of that
horse. Those sires and dams have other sires and dams which have sires
and dams and so on.

How do I set up the relationships for this database?

I also have some lookup tables that describe sex, color, etc. Do I
need to include these tables in the relationships diagram?

You don't need a separate table for progeny. Include a sire field and a
dam field in the horse record that contains the id of the sire and dam
respectively.
You can then include the horse table as many times as you need to in a query
to show the bloodline as far back as you want.

Tom Lake
 
J

Jamie Collins

You don't need a separate table for progeny. Include a sire field and a
dam field in the horse record that contains the id of the sire and dam
respectively.

The OP is describing a tree.

You appear to be describing the adjacency list model.

The OP should also consider the nested sets approach:

http://www.intelligententerprise.com/001020/celko.jhtml

or this from the Access MVPs ("nested set solutions are up to 1000
times faster than their equivalent methods"):

http://www.mvps.org/access/queries/qry0023.htm

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top