Dulranga's Notes
Semester 3Database Systems

Entity Relationship Model

A representative model to visualize how Database Tuples, relations connect to each other.

Entity

Represents an object or concept that can be uniquely identified. Described by a set of attributes. Illustrated as a rectangle.

Entity Set

Represents a collection of entities of the same type.

entity.png

Relationship

Represents an association between multiple entities.

relationship.png

Degree

How many entities are participating in the relationship. Most of the time relationships are binary, relationships with more degree are harder to work with thus can be simplified further. 4 types of degrees of relationships.

  1. Unary
  2. Binary
  3. Ternary
  4. N-ary
UnaryBinaryTernary
![[unary.png]]![[binary.png]]![[ternary.png]]

Cardinality

How many entities can be participated for the relationship from each side.

One-to-One (1:1)

Each entity in AA is related to at most one entity in BB, and vice versa.

One-to-Many (1:N)

Each entity in AA can be related to many entities in BB, but each entity in BB is related to only one entity in AA.

Many-to-One (N:1)

Each entity in AA relates to only one entity in BB, but an entity in BB can relate to many in AA.

Many-to-Many (M:N)

Entities in both sets can relate to many in the other.

Participation

Total Participation

Each entity in an entity set participates in at least one relationship instance. Illustrated as a double-line.

Partial Participation

Aka. optional participation. An entity may not participate in all relationship instances involving that entity set.

participation.png

On this page