I'm doing a site for a cat breeder, and I'm having some trouble coming up with a good structure for the MySQL database (what tables to use and how to link them together, especially how to link them together).
I've come up with a sketch of how I think it should work. I'll try to explain so that everyone understand 
I'll connect different things with "lines" (using - and |).
Code:
----- cats - all info about a cat
|---- litters - litters born
| |
|---|--- parents - parents to the litters ----------|
|---|--- kittens - kittens in the litters ----------|
| |
|---- our_cats - cats owned by the breeder ---------|
|--- shows - results from cat shows
Basically there is a table cats, which hold all information about ALL cats. litters is a seperate table (not linked with cats), which hold information about born litters. In every litter there is kittens and parents, with attributes that links them to a litter (or to several litters for parents). But kittens and parents is also linked with the cats table, which hold information about them.
our_cats is also linked with the cats table, all the breeders cats is in the cats table as well. But our_cats may also be linked with parents and kittens, because the breeders cats can become parents, and the breeder can keep some of the kittens as their own.
Then finally there is the shows table, which holds show results. It is linked to our_cats, because the breeder only take their own cats to shows.
This is as far as I get. I need help to implement this (or in some other way if someone can come up with something smarter) and to make the tables.
Thanks
lizciz
|