Question

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

Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top