I am creating a school system, I want together a list of linked teachers and materials Bank (MySql)

-1

I am creating a school system, I want to list a list of teachers linked to subjects and come and go. I use Mysql Bank

Example:

Professor 1 - Materia 1
Professor 1 - Materia 2
Professor 1 - Materia 3
Professor 2 - Materia 1
Professor 2 - Materia 3

Where the same teacher can be related in more than one subject, and the same subject can be related in more than one teacher! Do you have some way to do this?

    
asked by anonymous 02.09.2017 / 20:21

1 answer

1

What you need is a n x n relationship, that is, many to many. This type of relationship between two tables requires a third table that will contain the foreign keys of the two tables in question. Ex:

    
02.09.2017 / 20:39