0

I need to help to define a relationship in conceptual model for database. I'm doing it in PowerDesiner. I have 3 entities (let's call them A, B and C).

A doesn't have to have B, if A has B then only once.
B has to have at least one A.
B may have C, but doesn't have to.
C have precisely two B.
C has at least one A.
C can have A only if A is part of B, which is in relationship with C (one of the two B to C).
A may have C, but doesn't have to.

It's too complicated for me, I had an idea, but it turned out to be completely wrong. It's only a part of project, but the rest don't affect those 3. I need to do those limits on conceptual level, which is exactly my problem.

My first and propably the best idea was this http://i.snag.gy/Ofdze.jpg but it doesn't include the condition that C can have A only if A is part of B, which is in relationship with C (one of the two B to C)

Then I came up with this http://i.snag.gy/gKNQ9.jpg but as the solution before I think that it doesn't contains the same condition, even worse seems to be really messed up solution.

Grim
  • 37
  • 2
  • 10
  • Suggestion: state your relationships the way they would show up on the model. E.g. "One or many A has zero to one B," "Two B has zero to many C," etc. You need to resolve your associations to model it correctly. So add entities for the A to B relationship, and the B to C relationship. It's fine to do that in a conceptual model when necessary. – NaturalData Dec 17 '15 at 13:08

1 Answers1

1

Ok,
for clarity I will refer to your relation conditions to the # of line you have described it, so Row_1-2 will refer to statements in 1st and 2nd row of your question.

Please, pay attention, there is a logical error in your 5th and 6th statements.
You say C has at least one A and C can have A only if.., the two are not possible toghether.
I will skip the 5th and keep the 6th in my answer.

Let's see, first of all add the relation between A and B

enter image description here

Then select the relation and right click it and select Change to Entity,
you will get:

enter image description here

Pay attention this new entity identifies the relation between A and B, you will need it to fulfill your 6th statement.
Now add relations between C and B and between C and A (through Rel_A-B)

enter image description here

Note, I have adjusted cardinalities in relation between B and C (2,2)

MtwStark
  • 3,866
  • 1
  • 18
  • 32
  • Thanks for the effort, I wasn't able to solve that by myself back then, so I modified the problem. Anyway what i meant by the 5th and 6th statment was, that C must have A and A can be assigned to C only if A is part of B, which is in relationship with C... Still your clarification is very helpful anyway, I might still use that – Grim Dec 07 '16 at 20:23
  • You are welcome. Now I understand better your 5th and 6th, I think the schema provided is still valid, you have only to set mandatory the relation from `C` to `A-B_Rel` to set cardinality from `0,1` to `1,1` – MtwStark Dec 08 '16 at 21:10