0
Hello,
I have the following problem:
I have the PERSON table and COURSE table, each person can choose more than one course, the id of the chosen courses need to be saved within the person table, what would be the best way to do?
0
Hello,
I have the following problem:
I have the PERSON table and COURSE table, each person can choose more than one course, the id of the chosen courses need to be saved within the person table, what would be the best way to do?
2
The ideal would be for you to have a table template similar to this:
In these cases you wonder:
When we come across this situation of N-N there is the need to come up with an auxiliary table to connect the two tables which in the case is the table "Personal Course", it only exists in order to make the connection of Person with Course.
In this case when I insert a record it would look like this: INSERT INTO Personal?
That’s right, this way gives right, then only recovers with personal Where=1
Thank you very much, it worked right here
Browser other questions tagged mysql
You are not signed in. Login or sign up in order to post.
You are only referring to the database modeling part and SQL?
– Victor Magalhães
That’s right, I thought about recording inside a varchar all ids but I think it’s gambiarra
– user3434888