High-Level Database Models

March 5, 2024

The Entity/Relationship Model

  1. Entity sets

  2. Attributes

  3. Relationships

Entity Sets

An \(\text{entity}\) is an abstract object of some sort, and a collection of similar entities forms an entity set.

Attributes

Entity sets have associated \(\text{attributes}\), which are properties of the entities in tha set.

Relationships

\(\text{Relationships}\) are connections among two or more entity sets.

Entity-Relationship Diagrams

An E/R diagram is a graph representing entity sets, attributes, and relationships.

The Movies entity set has four of our usual attributes: title, year, length, and genre.

  1. Stars-in is a relationship connecting each movie to the stars of that movie. This relationship consequently also connecets starts to the movies in which they appeared.

  2. Owns connects each movie to the studio that owns the movie. The arrow pointing to entity set Studios indicates that each movie is owned by at most one studio.

Multiplicity of Binary E/R Relationships

A binary relationship can connect any member of one of its entity sets to any number of members of the other entity set. Suppose \(R\) is a relationship connecting entity sets \(E\) and \(F\). Then:

Example

Multiway Relationships

A multiway realtionship in an E/R diagram is represented by lines from the relationship diamond to each of the involved entity sets.

Unified Modeling Language (UML)

UML CLass in UML is similar to an entity set in the E/R model.