Jump to content

Recommended Posts

Hello everyone =]

 

I am currently programming a horse color genetics system. There are many breeds of horses, and many different colors of horses. The tricky part is, each breed can only have a certain amount of colors that they come in.

 

I am trying to figure out the best database structure possible. So let me know what you think of this.

 

This will be the horse table, where each individual horses information is stored.[tt]

TABLE "horses"
--------------
horseID
breed
color

 

[tt]This will be a table full of ALL the colors.

TABLE "colors"
---------------
colorID
color (the name of the color)

 

This table will hold a list of ALL the horse breeds, and all possible color combinations using the "colorID" column of the "colors" table.

TABLE "breed_colors"
--------------------
breedID
breed (name of breed)
colors (This will hold a list of all possible color possiblities from the "colors" table.)

 

An example of what the "colors" row would hold in the "breed_colors" table would be something like this:

2,10,26,52,70

This would mean that breed could come out with those possible colors corresponding to the "colorID" in the table "colors".

 

Does this sound like it would be a good approach to the database design/idea of what I'm doing? If you have any suggestions to a better structure, please share your thoughts :)

 

Thank you all very much, I appreciate the time your taking to help me :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.