0

I'm trying to represent this:

  • A message can be sent to one or more recipients.
  • A user (recipient) can receive zero or more messages (but he/she could receive a message only once).

Is my database design correct?

enter image description here

2 Answers 2

0

enter image description here

In nutshell that what you are looking for. You do need composite primary key "binding" those 2 FK in intersection table. (all attributes are omitted for brevity)

USERS can receive zero - or - more messages Messages can be sent to one - or - more users.

ps.

Tool i used to generate image is a bit buggy - line bewteen mail_box and Users should be dotted.

2
  • A message has a sender and one or more recipient. Where is the sender here?
    – VansFannel
    Commented May 31, 2014 at 6:32
  • I have updated my question with a better diagram.
    – VansFannel
    Commented May 31, 2014 at 6:53
0

The answer for my question is YES. With this model, I can represent a message that could have only one recipient.

I have found this question and it has the same model than mine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.