Chapter 3 Building Conceptual and Logical Diagrams


Relationship property sheet Cardinalities tab

The Cardinalities tab contains the following properties:

Property Description
Cardinality Specifies the number of instances (none, one, or many) of an entity in relation to another entity. You can choose from the following values:

  • One-to-one (symbol: <1..1>) - One instance of entity A can correspond to only one instance of entity B.
  • One-to-many (symbol: <1..n>) - One instance of entity A can correspond to more than one instance of entity B.
  • Many-to-one (symbol: <n..1>) - More than one instance of entity A can correspond to the same one instance of entity B.
  • Many-to-many (symbol: <n..n>) - More than one instance of entity A can correspond to more than one instance of entity B. To use n..n relationships in an LDM, see Enabling many-to-many relationships in an LDM.

For information about the termination points of the relationships in each of the supported notations, see "Supported CDM/LDM notations" in the Working with Data Models chapter.

In addition, this tab contains a groupbox for both directions of the relationship, each of which contains the following properties:

Property Description
Dominant role In a one-to-one relationship, you can define one direction of the relationship as dominant. If you define a dominant direction, the one-to-one relationship generates one reference in the PDM. The dominant entity becomes the parent table. If you do not define a dominant direction, the one-to-one relationship generates two references.

The relationship pictured here shows the one-to-one relationship.


In a PDM, this relationship generates the following reference: Author is the parent table, and its primary key migrates to the Picture table as foreign key.
Role name Text that describes the relationship of EntityA to EntityB.
Dependent In a dependent relationship, one entity is partially identified by another. Each entity must have an identifier. In some cases, however, the attributes of an entity are not sufficient to identify an occurrence of the entity. For these entities, their identifiers incorporate the identifier of another entity with which they have a dependent relationship.

For example, an entity named Task has two entity attributes, TASK NAME and TASK COST. A task may be performed in many different projects and the task cost will vary with each project. To identify each occurrence of TASK COST the unique Task entity identifier is the compound of its Task name entity attribute and the Project number identifier from the Project entity.

A many-to-many relationship cannot be a dependent relationship.

The relationship pictured here expresses this dependency.


The circle at the top of the triangle indicates that occurrences of the Project entity do not require an occurrence of the Task entity. But an occurrence of the Task entity requires an occurrence of the Project entity on which it depends.
Mandatory Indicates that the relationship between entities is mandatory. You define options from the point of view of the both entities in the relationship.

For example, the subcontract relationship is optional from customer to project, but mandatory from project to customer. Each project must have a customer, but each customer does not have to have a project.
Cardinality Specifies the maximum and minimum number of instances of EntityA in relation to EntityB (if mandatory, at least 1). You can choose from the following values:

  • 0..1 – Zero to one instances
  • 0..n – Zero to many instances
  • 1..1 – Exactly one instance
  • 1..n – one to many instances

 


Copyright (C) 2008. Sybase Inc. All rights reserved.