Home Enhanced Entity Relationship Modeling - Theoretical questions
Reply: 1

Enhanced Entity Relationship Modeling - Theoretical questions

iNemesis
1#
iNemesis Published in 2018-01-13 01:28:44Z

This question already has an answer here:

  • How to create tables with N:M relationship in MySQL? 2 answers
  • One-to-Many relationship in MySQL - how to build model? 3 answers
  • Why use a 1-to-1 relationship in database design? 6 answers
  • How to implement one-to-one, one-to-many and many-to-many relationships while designing tables? 3 answers

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!

Julien Ambos
2#
Julien Ambos Reply to 2018-01-13 01:34:03Z
  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
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.330412 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO