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.

Strong Entity

An entity set is strong iff it has its own primary key.

Weak Entity

When an entity set is not strong. Depends on another entity set to unique identification. The other entity is called the identifying entity set.

Entity Set

Represents a collection of entities of the same type.

entity.png

Relationship

Represents an association between multiple entities.

relationship.png

Strong Relationship

If all the entities that participate in that relation are Strong, then that is a Strong relationship.

Weak Relationship

If a relationship is not strong, i.e. at least one entity with no primary key, then its a weak relationship

Degree

(aka arity) 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.pngternary.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