DbView         Database visualization






Cardinalities

A "cardinality" represents the number of potential associations between two records, through two fields located into two distinct tables.

DbView distinguishes between four kinds of cardinalities:

Please note that these notations are inspired from the regular expressions (widely used by developers).

Description DbView notation UML motation Merise motation
One, and only one 1 1 1,1
Zero or one ? 0..1 0,1
Zero, one or more * * 0,n
One or more + 1..* 1,n

A cardinality is associated to a join.

Graphically, cardinalities are represented in a four columns grid, in the middle of an arrow that represents a joini.

Example:
 

In the following text, we represent the four columns grid with the notation:

CA | @A | @B | CB

CA CB Description
* *
  • @A is associated with zero, one or more @B.
  • @B is associated with zero, one or more @A.
* +
  • @A is associated with one or more @B.
  • @B is associated with zero, one or more @A.
* ?
  • @A is associated with zero or one @B.
  • @B is associated with zero, one or more @A.
* 1
  • @A is associated with one and only one @B.
  • @B is associated with zero, one or more @A.
+ *
  • @A is associated with zero, one or more @B.
  • @B is associated with one or more @A.
+ +
  • @A is associated with one or more @B.
  • @B is associated with one or more @A.
+ ?
  • @A is associated with zero or one @B.
  • @B is associated with one or more @A.
+ 1
  • @A is associated with one and only one @B.
  • @B is associated with one or more @A.
? *
  • @A is associated with zero, one or more @B.
  • @B is associated with zero or one @A.
? +
  • @A is associated with one or more @B.
  • @B is associated with zero or one @A.
? ?
  • @A is associated with zero or one @B.
  • @B is associated with zero or one @A.
? 1
  • @A is associated with one and only one @B.
  • @B is associated with zero or one @A.
1 *
  • @A is associated with zero, one or more @B.
  • @B is associated with one and only one @A.
1 +
  • @A is associated with one or more @B.
  • @B is associated with one and only one @A.
1 ?
  • @A is associated with zero or one @B.
  • @B is associated with one and only one @A.
1 1
  • @A is associated with one and only one @B.
  • @B is associated with one and only one @A.