user2637293
user2637293

Reputation: 351

Understanding ER diagrams

i try to understand ER diagrams and i came across an example that i'm not sure how to "look" at it..

Consider this diagram: enter image description here

What is the difference between the above and this diagram: enter image description here

From what i have learned, the last diagram says "for every couple of school and teacher, there is one and only course" . So, if i have 3 schools, 3 teachers and 3 courses, there will be 9 triplets in Teaches relationship. What the first diagram changes? what kind of 2 triplet that exist in Teaches in the last diagram, can't be in the first diagram?

I try to first look at the diagram without constraints.So i have maximum 27 triplets (for the above example).After that, there is an order of what to do? can i first can put the rounded arrow of Course, of first to put the regulat arrow to teacher?

Upvotes: 1

Views: 6020

Answers (1)

Peyman Mohamadpour
Peyman Mohamadpour

Reputation: 17964

Quick answer

The difference between two diagrams is the joint type of teacher and the relation teaches, which represents a

Many-to-One
Partial

relationship in first diagram and a

Many-to-Many
Partial

relationship in the second one.

Explained answer

Let R be a relationship set between entity sets A and B. The participation of A is total if every entity of A must participate in at least one relationship in R. Otherwise, the participation of A is partial.

Consider the simple diagram below:

enter image description here

The line connecting A and R may:

  • Carry an arrow: Meaning one (as in one-to-many).
  • Not carry an arrow: Meaning many.
  • Be a double line: Meaning total participation.
  • Be a single line: Meaning partial participation.

Upvotes: 1

Related Questions