Pregunta

I engineered an ERD diagram using Barker's notation. The problem was to make a database for system of water pipes where one node is connected to another using a section (pipe), each node can have unlimited number of pipes connected, but the pipe must have only two nodes that it's connected to. Each node that is situated in certain location can have zero or more devices attached. enter image description here

My other idea was to create one to many relation (section can be assigned to many nodes). Is my diagram correct?

UPDATE:

After comments I changed the relations (embedded location in node as well).

Here is the output:

enter image description here

¿Fue útil?

Solución

I think your model could be better. As it is it allows a section to be related to many node_sections rather than to maximum of 2. You could either:

  • write a digit 2 on the diagram to show that there is a maximum cardinality at that end of the relationship; or

  • drop node_section and have two 1:m relationships directly between node and section. If your pipe network has a fixed direction of flows then call the relationships source and sink, otherwise call them end1 and end2.

Licenciado bajo: CC-BY-SA con atribución
scroll top