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

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.

  • A message has a sender and one or more recipient. Where is the sender here? – VansFannel May 31 '14 at 6:32
  • I have updated my question with a better diagram. – VansFannel May 31 '14 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, privacy policy and cookie policy

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