-1

I am building an ER diagram for Container and Shipping Company and I need help in understanding my mistakes and suggestion on building ER diagram and realtionship between entities. Below is the picture of the diagram I have built till now:

.[Container and Shipping Company ER Diagram]()

  1. I have tried refering different books but I am no where to understand if I am heading in correct direction speacially when it comes to establishing relationship bewteen entities.
  2. How to resolve Many-to-Many relationship (if there are any)?
  3. How to implement resolved Many-to-Many relationship in SQL?
  4. What are the references I can consider for building this ER diagram?
Christophe
  • 68,716
  • 7
  • 72
  • 138
  • Mind to add the problem statement, otherwise its not good for us to infer things, thanks ! – jmvcollaborator Apr 13 '23 at 02:40
  • I have a task given for data modelling using all possible entities I can think of for a Container and Shipping Company. Where this company sends Cargo using their Vessel and Containers from one Port to another. So based on this I need to build an er diagram – Jay Thakur Apr 13 '23 at 12:13

1 Answers1

0

It's a little bit broad, so I won't review the full diagram.

  1. Yes, you're heading in the right direction: your diagram says that one customer can have several bookings, and the booking can have several invoices but must have at least one (this might be too strong if bookings are not immediately invoiced). The use of PK and FK to implement one-to-many relationship seems correct as well.
  2. There's no many-to-many relationship modelled here (i.e. with crowfoot on both sides). However, there is according to your model a many-to-many relation between cargo and vessels, and it was resolved using the intermediary table in blue. You can recognise this at the composite PK, made of two FK.
  3. Exactly as in two. Whenever you have a many-to-many relationship, you'd add an association table and break the relationship in two one-to-many relationships.
  4. Unclear, what you're asking in this last point.
Christophe
  • 68,716
  • 7
  • 72
  • 138