Relationship (Database) (Sql)

3

please:

I can not understand the following case:

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

In case it would be, 1 Department lota 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.

By doing the (1,1) and (1, N), how do I come to the conclusion that this relationship is 1: N? I get the first element of "Department" and the second element of "Employee" and I come to that conclusion?

Thank you!

    
asked by anonymous 12.04.2017 / 00:00

1 answer

0

You should always pick up the strongest relationship, in this case N.

Do not forget that the lozenge is only used to guide your head and to see what kind of relationship exists between the two tables. The ratio of 1 to N prevails because the N weighs ever 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 many-to-many relationship.

If you had (1: N) - (1: 1) would be (N: 1).

I hope I have helped!

    
12.04.2017 / 12:23