# Logical Data Modeling - Relationship Representation / Implementation / Visualisation

A relationship can be described/implemented by:

## Type

### Function

A relationship can be represented as a function

Example with a three element (ternary) relationship: $$y = f(x,z)$$

### Operator

A binary relationship can be represented as an operator $$y <= x$$

### Set of tuples

A relationship can be represented as a set of tuples of every entity identifier.

For instance, the relation less than or equal (⇐) on the set of integers {1, 2, 3} is the set of tuple:

<1, 1>
<1, 2>
<1, 3>
<2, 2>
<2, 3>
<3, 3>


The set of tuples can physically be implemented as:

• in a relational database
• in code:
• a field from an object A with the id value of an object B

### Graphic

The relationship less than or equal (y⇐x) can be represented in the set $R$ against $R^2$ as the below gray area:

### Association

The below diagram defines two associations:

• a book is published by one publisher and a publisher publishes many books
• a book is written by many author and a author writes many books