Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to model N-M association tables? #21

Open
echatzikyriakidis opened this issue Jun 9, 2023 · 0 comments
Open

How to model N-M association tables? #21

echatzikyriakidis opened this issue Jun 9, 2023 · 0 comments

Comments

@echatzikyriakidis
Copy link

Hi @avsolatorio !

I was wondering how someone could model N-M table relationships.

Currently, we can model 1-1 and 1-N relationships with parent (tabular) and child (relational) models. However, is it possible to model N-M association tables?

An example association table could be student_courses_registrations that unites students and courses. A student can attend many courses and a course could be taken by multiple students:

courses ---- 1-N ---> students_courses_registrations <----- M-1 ----- students

Should we create parent tabular models for courses and students tables and then somehow use a child relational model for students_courses_registrations? Is it possible?

I can't find a way to do it. I was wondering if there is way to convert a N-M table to multiple 1-N relationships and then model the relationships separately. Of course later on I will have to revert the process to convert them to a N-M single table when sampling data.

What do you think? Is there a way to do it?

@echatzikyriakidis echatzikyriakidis changed the title How to model N-M tabular relationships How to model N-M association tables? Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant