1

There is a part of an entity-relationship diagram creation that troubles me, I don't know if it's ok. I tried to follow these instructions:

  1. A client makes an order (which has products).
  2. When the client pays, he or she gets a bill with information about the order.

My attempts

Is this one ok?

enter image description here

Or this one?

enter image description here

  • How different are Bill and Order? Most systems I've worked on just have a status on order to indicate if it is an order or a bill. I'd lean towards your second diagram. – Greg Dec 30 '17 at 20:35
2

First of all you have to define your entities.

So I see 4 entities:

  1. Client
  2. Order
  3. Product
  4. Payment

With these 4 entities you can create your bill from the information that is already stored in the database.

After you have decided on your entities you need to normalise them before you can go near the ER diagram. With the ER diagrams that you provide, I do not see 1:1 or 1:M relationships. I can see that order has a 1:M relationship with product and that client has a 1:1 relationship with Order. Perhaps there is just a 1:1 relationship between client a payment or can there be many payments?

In any case, the ER diagram should start with client as they start the transaction. I can see a ternary relationship between order, product and payment.

Does this help? I hope it does help you to think more about it. I would not be happy with either diagram because they do not contain 'product'. Can you try and add product and the type of relationships?

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.