Entity-Relationship Diagram

It is a high level data model diagram which defines the conceptual view of the database. It indicates the relation among entities.
Before making the actual database, first the ER-diagram is drawn to show the relations and many more things.

Components …


This content originally appeared on DEV Community and was authored by hebaShakeel

It is a high level data model diagram which defines the conceptual view of the database. It indicates the relation among entities.
Before making the actual database, first the ER-diagram is drawn to show the relations and many more things.

Components of ER Diagram:

1) Entity
i) It is a real-world object.
ii) It can be physical.
iii) It can be logical.

Entity Set - It is a set (or collection) of entities of the same type which share the similar properties or attributes.

An entity can be characterized into two types:

i) Strong Entity -
-> It has a Primary Key.
-> It is not dependent.
-> They are shown in single rectangle
ii) Weak Entity -
-> It doesn't have the sufficient attributes to form Primary Key.
-> It is dependent on the Strong Entity.
-> They are shown in double Rectangle.

Example
Alt Text

Total Participation - Weak Entity always has total participation with the Relationship. This means that each entity in the entity set must compulsorily participate in at least one relationship instance in that relationship set.

2) Attributes - They are the properties that describe the entity.

An attribute can be characterized into:

1) Simple Attributes: They are represented by oval.

Example

Alt Text

2) Multi-valued Attributes: Multiple values for a single attribute. They are represented by double oval.

Example

Alt Text

3) Single-Valued Attributes: Each and every entity will have only one value.
Example - ID

4) Composite Attributes: Those attributes that can be divided further.

Example
Alt Text

5) Derived Attributes: Those attributes whose values are derived from another attribute. They are represented by dotted oval.

Example

Alt Text

Age is a derived attribute since age can be derived from the Date of Birth.

6) Key Attribute: Attribute which can uniquely define the whole tuple is called a Key Attribute.

Example- ID
Alt Text

3) Relationship
It indicates how each and every entity is related with every other entity.

Degree of Relationship: A relationship where a number of different entity set participate is called as degree of a relationship.

Degree of relationship can be categorized into the following types:

1) Unary - Only one Entity set participates in a relationship.

Example
Alt Text

2) Binary - Two Entity Sets participate in a relationship.

Example
Alt Text

It is further divided into four types:
i) One-to-One:
Alt Text

ii) One-to-Many:
Alt Text

iii) Many-to-One:
Alt Text

iv) Many-to-Many:
Alt Text

3) Ternary - When three entity sets participate in a relationship.
Alt Text

4) n-ary - When more than three entity set involves in a relationship, it is called n-ary relationship.

Summary of ER-Diagram Symbols
1) Entity or Strong Entity:
Alt Text

2) Weak Entity:
Alt Text

3) Attribute:
Alt Text

4) Multi-valued Attribute:
Alt Text

5) Relationship:
Alt Text

6) Weak Relationship:
Alt Text

That's all for today.
Thank You.
Hope to see you in my next article...


This content originally appeared on DEV Community and was authored by hebaShakeel


Print Share Comment Cite Upload Translate Updates
APA

hebaShakeel | Sciencx (2021-06-05T11:44:37+00:00) Entity-Relationship Diagram. Retrieved from https://www.scien.cx/2021/06/05/entity-relationship-diagram/

MLA
" » Entity-Relationship Diagram." hebaShakeel | Sciencx - Saturday June 5, 2021, https://www.scien.cx/2021/06/05/entity-relationship-diagram/
HARVARD
hebaShakeel | Sciencx Saturday June 5, 2021 » Entity-Relationship Diagram., viewed ,<https://www.scien.cx/2021/06/05/entity-relationship-diagram/>
VANCOUVER
hebaShakeel | Sciencx - » Entity-Relationship Diagram. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/05/entity-relationship-diagram/
CHICAGO
" » Entity-Relationship Diagram." hebaShakeel | Sciencx - Accessed . https://www.scien.cx/2021/06/05/entity-relationship-diagram/
IEEE
" » Entity-Relationship Diagram." hebaShakeel | Sciencx [Online]. Available: https://www.scien.cx/2021/06/05/entity-relationship-diagram/. [Accessed: ]
rf:citation
» Entity-Relationship Diagram | hebaShakeel | Sciencx | https://www.scien.cx/2021/06/05/entity-relationship-diagram/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.