-3

I came across the question in interview, on following diagram.

Is this a one-to-many OR many to many relationship is this. Does arrow indicator makes matter? If no then is that one-to-many ?

enter image description here

Liladhar
  • 383
  • 5
  • 20

2 Answers2

3

This is many to many. Each user can have many permissions and each permission can be assigned to many users.

You can ignore the arrows as it does not appear to be any valid UML diagram.

danish
  • 5,550
  • 2
  • 25
  • 28
0

EDIT

This is many to many (P4).

More to this for making many to many then you would need a third table (jumper table) which will references of both the tables (their primary keys).

JSK
  • 583
  • 6
  • 17
  • Just arrow indication, I don't think so making the matter. Though you will have the third table, and say there can be query line 'select users of P4' then it will return user list. in this scenario I don't think so it is one-to-many relationship. – Liladhar Dec 23 '14 at 13:02
  • 1
    yes you are right, I missed the P4, but in actual design you would a need a third table. I have edited the answer. – JSK Dec 23 '14 at 13:05
  • Several times I do ask this question to people. And they answers one to many. but when I specify P$ condition, they reverts answer to many-to -many. This is actually the m-to-m relation. Arrows doesn't matters here. – Liladhar Jun 23 '15 at 07:00