You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attributes are the properties of entities. Attributes are represented by means of ellipses. Every ellipse represents one attribute and is directly connected to its entity (rectangle).
If the attributes are composite, they are further divided in a tree-like structure. Every node is then connected to its attribute. Composite attributes are represented by ellipses that are connected with an ellipse.
@@ -58,24 +110,72 @@ A relationship where two entities are participating is called a binary relations
58
110
59
111
When only one instance of an entity is associated with the relationship, it is marked as '1:1'. The following image reflects that only one instance of each entity should be associated with the relationship. It depicts one-to-one relationship.
60
112
113
+
```mermaid
114
+
---
115
+
title: One-to-One Relationship
116
+
---
117
+
erDiagram
118
+
ENTITY1 ||--|| ENTITY2 : relationship
119
+
```
120
+
61
121
#### One-to-Many
62
122
63
123
When more than one instance of an entity is associated with a relationship, it is marked as '1:N'. The following image reflects that only one instance of entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts one-to-many relationship.
64
124
125
+
```mermaid
126
+
---
127
+
title: One-to-Many Relationship
128
+
---
129
+
erDiagram
130
+
ENTITY1 ||--o{ ENTITY2 : relationship
131
+
```
132
+
65
133
#### Many-to-One
66
134
67
135
When more than one instance of entity is associated with the relationship, it is marked as 'N:1'. The following image reflects that more than one instance of an entity on the left and only one instance of an entity on the right can be associated with the relationship. It depicts many-to-one relationship.
68
136
137
+
```mermaid
138
+
---
139
+
title: Many-to-One Relationship
140
+
---
141
+
erDiagram
142
+
ENTITY1 }o--|| ENTITY2 : relationship
143
+
```
144
+
69
145
#### Many-to-Many
70
146
71
147
The following image reflects that more than one instance of an entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts many-to-many relationship.
72
148
149
+
```mermaid
150
+
---
151
+
title: Many-to-Many Relationship
152
+
---
153
+
erDiagram
154
+
ENTITY1 }o--o{ ENTITY2 : relationship
155
+
```
156
+
73
157
### Participation Constraints
74
158
75
159
#### Total Participation
76
160
77
161
Each entity is involved in the relationship. Total participation is represented by double lines.
78
162
163
+
```mermaid
164
+
---
165
+
title: Total Participation
166
+
---
167
+
erDiagram
168
+
ENTITY1 ||--|| ENTITY2 : relationship
169
+
```
170
+
79
171
#### Partial Participation
80
172
81
-
Not all entities are involved in the relationship. Partial participation is represented by single lines.
173
+
Not all entities are involved in the relationship. Partial participation is represented by single lines.
Copy file name to clipboardExpand all lines: docs/DBMS/data-models.md
+52-3Lines changed: 52 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,27 @@ Flat data models were the earliest, where all data was kept on the same plane. H
19
19
20
20
The Entity-Relationship (ER) Model is based on real-world entities and their relationships. It creates entity sets, relationship sets, attributes, and constraints, making it suitable for conceptual database design.
0 commit comments