This question already has an answer here:
How to create tables with N:M relationship in MySQL?
One-to-Many relationship in MySQL - how to build model?
Why use a 1-to-1 relationship in database design?
How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?
Well i have some basic theoretical questions about EER modeling on MySql Workbench for a school project.
So There are like 6-7 entities as far as i can understand. It has to do with users split to teachers and students. Teachers can set one or many thesis (title, description, etc) and a TODO_list pointing to that thesis. Then one or many TODO_lists are assigned to a student. Also some basic "media like" interaction with likes, follows, friends, comments on posts, etc.
I really couldn't attend class this year and things are getting blurry.
So i need on someone to answer me these basic questions.
1) If u have 2 tables and the relationship between them is a 1:1 relationship you just link them together and the primary key of "table_2" goes as secondary key to "table_1" ?
2) if u have 2 tables and the relationship between them is a N:M relationship then you create a third table (pivot table i think is its name) that contains both primary keys of "table_1" and "table_2" ?
3) what happens to a 1:M relationship ?
Thank you in advance!