Relationship (Database) (Sql)

Asked

Viewed 164 times

4

kindly:

I can’t understand the following case:inserir a descrição da imagem aqui

My problem would be the syntax used in part (1,1) -- (1,N)

In case it would be, 1 Department allots N employees and 1 Employee can be in only 1 department. So far so good, but the cardinality of the elements between the parentheses that disturbs me.

Doing (1.1) and (1.N), how do I come to the conclusion that this relationship is 1 : N? I take the first element of "Department" and the second element of "Employee" and I come to this conclusion?

Thank you very much!

1 answer

0


You should always take the stronger relationship, in case the N.

Do not forget that the rhombus 'stocking' serves only to guide your head and realize what kind of relationship exists between the two tables. The ratio of 1 to N prevails because N always weighs more.

If you had (N:1) -- (1:N) would be (N:N) and would have to create an associative table because it would be a relation of many to many.

If it had (1:N) -- (1:1) it would (N:1).

I hope I’ve helped!

Browser other questions tagged

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