Relationship between tables in MySQL

1

I am creating a website and I have a problem with it, in this site I will show some characters in the game League of Legends and show which character is strong or weak in relation to others, 1 is strong against character 2 but is weak against character 3.

I have the CAMPEOES table and registered it: | champ_id | champ_nome | champ_descricao | champ_avatar |

To create this relationship I will need to create another table to relate them or I can do something in the championship table since it has the information that I will need that are champ_nome and champ_avatar .

The characters can be related to several other characters at the same time.

    
asked by anonymous 10.03.2015 / 21:12

1 answer

1

The problem was solved and Rafael helped me think about how the logic of the tables that will be related would look like ...

I decided to create two tables that are campeao_forte and campeao_fraco both have the structure .._principal and .._secundario and in the table campeao_forte in its column .._primario will be recorded the ID of the champion that is strong and in the secondary will be recorded the ID of the champion that is weak against the primary.

The same occurs in the campeao_fraco table, however the primary indicates that the champion is weak against the secondary.

    
10.03.2015 / 23:46