databaserelational-databasedata-modelingerd

One to many relationship in Product Ordering System with Crow's Foot Notation


In the image below you can see a one-to-many relationship between Order and Order_Product.

I am fine with this except two things:

Can anyone correct me if I am wrong?

one to many relationship between Order and Order_Product tables

The complete ERD could found here: https://circle.visual-paradigm.com/simple-order-system/


Solution

  • there are many variants and shorthand forms of Crow's foot notation, so firstly check your references to see if they give a precise specification. I'll compare your diagram to wikipedia's description. But see also their 'Related diagramming convention techniques'.

    • I think the circle should be removed because any single order in Order is associated with one or many rows in Order_Product table.

    If the circle is deliberate, it's showing it's valid within this model for there to be an Order with zero Order-Product. Typically at the start of a customer placing an order, there's not yet any Products mentioned. Or the Order might be for services rather than discrete Product: my car is making a funny noise, please send a mechanic.

    • The single bar should be double bar because any single row in Order_Product is associated with one and only one order in the Order table.

    Yes in that wikip description and example diagram, there should be both a min and max. 'One and only one' would be a common specification with Foreign Key references. It would be an obvious shorthand to put a single bar in this case.