Hi,
I regarded composite primary key and it is not a third table. The composite primary key is more than one primary key in one table. This prevents repetation of the two keys values togather.
For instance item_cat table. The two fields of item_cat are primary key:
cat_id
item_id
This means that every cat will have one item and any item will be represented in many cats
cat_id item_id
1 2
1 3
2 2
1 4
3 1
The third table you asked for is cat table. which is:
cat_id(int)*
cat_title
cat_description
etc...
From the sample of tables that you supplied, I can advice you with the following:
Keep the first two tables as they are, but ofcourse be sure that fields are primary keys
Animal table
AnimalID (int)primary key
Name
Age
Experience table
ExpID (int)* primary key
Experience
The change will be carried out to the third table:
AnimalExperience table
// Remove this-> AnimalExpID (int)
AnimalID(int)
ExipID(int)
You don't need this AnimalExpID, the other two primary keys are fine, if you have any other useful data to be replaced with it it will be more logic.
In these three tables we esatblish a state know, in the database design, by Normalization.
You have many to many relationship Animals and Their experience. This mean that it is possible for any animal to have one or more experience and in the same time the it is possible for any experience to have or to include one or more animal.
This is the core and the major use of Relational Database The ability of normalization