Minimum and maximum cardinality - Relational Model

Asked

Viewed 316 times

0

Guys, I’m very much in doubt of these 2 tables...

inserir a descrição da imagem aqui

Right, I asked 2 questions for my tables:

  1. User, you can register how many courses?

    A: None or N courses

  2. Course, for you to be registered, you need how many users?

    A: At least 1 user or N courses

I got these 2 answers... Now my question is: If it happened (1,n) and (0,n) should I place the foreign key in which table? Or even create a new table for that relation?

I am sorry if information is missing for my doubt. I will add soon.

1 answer

2

For this type of relationship (N:N) you have to create an auxiliary table that represents the registration relationship. In this table you will have the foreign keys of each of the entities involved and each pair will mean an occurrence of the relationship.

  • So @anonimo, even though you have a relationship of (0.n) and (1.n)? Should I disregard the minimum cardinality? If you can explain me better.

  • The problem of minimum cardinality is dealt with by whether or not the occurrence of the value in the foreign key.

  • Right. Thank you for the answer explained. On the negative vote, what should I do in question?

  • I do not know. I have no idea who gave such a vote and for what reason.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.