Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Relationships

Relationships are the associations between the entities. Verbs often describe relationships between entities. We will use Crow's Foot Symbols to represent the relationships. Three types of relationships are discussed in this lab. If you read or hear cardinality ratios, it also refers to types of relationships.

  • One to One relationship.

  • One to many or many to one relationship.

  • Many to many relationships.

1. One to One Relationship

When a single instance of an entity is associated with a single instance of another entity then it is called one to one relationship. For example, a person has only one passport and a passport is given to one person.

2. One to Many Relationship

When a single instance of an entity is associated with more than one instances of another entity then it is called one to many relationship. For example – a customer can place many orders but a order cannot be placed by many customers.

3. Many to Many Relationship

When more than one instances of an entity is associated with a single instance of another entity then it is called many to one relationship. For example – many students can study in a single college but a student cannot study in many colleges at the same time.

  • The one-to-many (1:M) relationship is the norm for relational databases

  • In the one-to-one (1:1) relationship, one entity can be related to only one other entity and vice versa

  • The many-to-many (M:N) relationship can be implemented by creating a new entity in 1:M relationships with the original entities

    • A composite entity (i.e., bridge or associative entity) helps avoid problems inherent to M:N relationships

      • It includes the primary keys of tables to be linked

1:M

1:1

M:N

Converting the M:N Relationship into a 1:M

  • No labels