-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRelationships.er
33 lines (26 loc) · 987 Bytes
/
Relationships.er
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
dbdia example - relationship definition examples
Eduardo Marques
https://github.com/edrdo/dbdia
*/
EntityA ( ) // with no attributes (just for convenience)
EntityB ( ) // you can in any case ommit attributes in diagrams
EntityC ( ) // using the 'rel' diagram type generation
// Relationship: Rel1
// Entities involved: EntityA and EntityB
// Cardinality: 1 to N
// Participation: partial for EntityA, total for EntityB
// Relationship attributes: none
EntityA --- 1 --- < Rel1 > === N === EntityB
// Relationship: Rel2
// Entities involved: EntityA and EntityB
// Cardinality: M to N
// Participation: partial for both entities
// Relationship attributes: none
EntityA --- M --- < Rel2 > --- N --- EntityB
// Relationship: Rel3
// Entities involved: EntityA and EntityC
// Cardinality: 1 to 1
// Participation: total for EntityA, partial for EntityC
// Relationship attributes: Rattr1, { RAttr2 } as shown.
EntityA === 1 === < Rel3( RAttr1, { RAttr2 } )> --- 1 --- EntityC