> For the complete documentation index, see [llms.txt](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/the-entity-relationship-model-details/er-diagram-components.md).

# ER Diagram Components

![](https://1736932896-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5-0RGXrGEYT2sPemdS%2F-M5-0Rgnjb23s9oFr3lT%2F-M5-0_JkwMP8VhTuc6jf%2FER%20Components.JPG?generation=1586990834578716\&alt=media)

![](https://1736932896-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5-0RGXrGEYT2sPemdS%2F-M5-0Rgnjb23s9oFr3lT%2F-M5-0_JmgEO1pr9sJYoK%2FER%20Components%202.JPG?generation=1586990834494444\&alt=media)

## Role

An entity can be related to itself. The labels of the relationship are called roles.

For example:![](https://1736932896-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5-0RGXrGEYT2sPemdS%2F-M5-0Rgnjb23s9oFr3lT%2F-M5-0_JoLkA5KXD9G2c0%2FRoles.JPG?generation=1586990834652837\&alt=media)Participation

* **Total participation** (indicated by double line): every entity in the entity set participates in at least one relationship in the relationship set
* **Partial participation**: some entities may not participate in any relationship in the relationship set

## Weak Entity Sets

A weak entity set is one that doesn't have a primary key. Its existence depends on the existence of other entity set(s), known as **strong**/**identifying** entity set(s).

It must relate to the identifying entity set via a total, one-to-many relationship set from the identifying to the weak entity set. Also, the Identifying relationship is depicted using a double diamond.

The **discriminator** (or **partial key**) of a weak entity set is the set of attributes that distinguishes among all the entities of a weak entity set. It is underlined using a dashed line.

The primary key of a weak entity set is formed by the primary key of the strong entity set on which the weak entity set is existence-dependent, plus the weak entity set’s discriminator.

## Specialization/Generalization

This is another term for inheritance.

The lower-level entity set inherits all the attributes and relationship participation of the higher-level entity set to which it is linked.

Some constraints while modeling a specialization include:

* constraint on which entities can be members of a given lower-level entity set
* constraint on whether or not entities may belong to more than one lower-level entity set within a single generalization
  * disjoint: an entity can belong to only one lower-level entity set &#x20;
  * overlapping: an entity can belong to more than one lower-level entity set
* completeness constraint: specifies whether or not an entity in the higher-level entity set must belong to at least one of the lower-level entity sets within a generalization
  * total: an entity must belong to one of the lower-level entity sets &#x20;
  * partial: an entity need not belong to one of the lower-level entity sets

## Aggregation

It is used to represent a relationship between relationships.

![](https://1736932896-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5-0RGXrGEYT2sPemdS%2F-M5-0Rgnjb23s9oFr3lT%2F-M5-0_JqdbcpJD1Zz9Z_%2FAggregation.JPG?generation=1586990834709477\&alt=media)
