Thursday, March 2, 2017

Describe cardinality ratios with example ERD

Define Cardinality ratio, Define Mapping cardinalities, What are the different types of relationships, Example ER diagrams for cardinality ratio


Cardinality ratios

In ER model, a relationship is an association among entities (records) of one or more entity sets. Cardinality ratio or mapping cardinalities is a concept that describes binary relationship set (a relationship that connects two entity sets) and its types. It is about the maximum number of entities of one entity set that are associated with the maximum number of entities of the other entity set.

For example, let us assume an entity set Department (to model information about departments) and courses entity set (to model the courses that are offered by a department). To establish a link (relationship) between these two entity sets we need to define the number of entities (records) of department that are associated with number of entities (records) of courses. As per our design requirement, if a Department can offer many courses and a course can only be offered by at most one department, then the relationship between department and courses is a one-to-many relationship from department to courses (or the cardinality ratio between department and courses is one-to-many).

See the example shown in the ERD below; [arrow head side - one side, without arrow – many side]

One-to-many relationship OFFERS from entity Department to Courses


The following are the types of relationship sets [cardinality ratios];
  • Many-to-one relationship
  • Many-to-many relationship

*************












4 comments:

  1. Why is the relationship between student and course one-to-many? If a student can register for many courses then a course would also have many students opting for it right? Please explain.

    ReplyDelete
    Replies
    1. You are correct. But, in this example, we treated student entity as one side and course as many side. This is purely for example. I will change it. Thanks.

      Delete

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery