-1

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!

iNemesis
  • 119
  • 1
  • 8

1 Answers1

0
  1. If theres a one to one relationship, using normalization rules, you can put the columns and data of table two into table one and remove table two
  2. Correct
  3. In a one to many relationship, e.g. a customer can have multiple orders, the primary key of customers (customers_id) is the foreign (secondary) key in the orders table
Julien Ambos
  • 2,010
  • 16
  • 29