Mapping Cardinalities / Cardinality Ratio Cardinality defines the number of entities in one entity set, which can be associated with the number of entities of other set via relationship set. Cardinality specifies the maximum number of relationships. For binary relationship set R on an entity set A and B, there are four possible mapping cardinalities. These are as follows:
One-to-one One entity from entity set A can be associated with at most one entity of entity set B and vice versa. a1 a2 a3 a4 b1 b2 b3 b4 A B a1 a2 a3 a4 b1 b2 b3 b4 A B
One-to-one Examples One citizen has one Aadhar number , and the Aadhar number can only be used by one citizen . I ndian citizen Has Aadhaar number 1 1 One student has only one student ID, and each student ID is assigned to only one student . Student Has Student ID
One-to-many One entity from entity set A can be associated with more than one entity of entity set B, however an entity from entity set B can be associated with at most one entity from entity set A. a1 a2 a3 a4 b1 b2 b3 b4 A B
One-to-many Example Each customer may have more than one telephone number. but each telephone number will be associated to only one customer. Customer Has Telephone Number 1 N Customer Has Telephone Number
Many-to-one More than one entities from entity set A can be associated with at most one entity of entity set B, however an entity from entity set B can be associated with more than one entity from entity set A. a1 a2 a3 a4 b1 b2 b3 b4 A B
Many-to-one Example N 1 Student Enrolled in Course A student can take only one course, but one course can be taken by many students. So, the cardinality will be N to 1. It means that for one course there can be N students but for one student, there will be only one course. E mployee Works in D epartment
Many-to-many One entity from A can be associated with more than one entity from B and vice versa. a1 a2 a3 a4 b1 b2 b3 b4 A B
Many-to-many Examples Each customer may place an order for many products, and each product might be ordered by many customers. Customer Places Order Product M N Employee Works On Project An employee may work on multiple projects, and a project may have multiple employees working on it.
Thanks for watching!
If you have a question, you can reach me via e-mail at [email protected] Social Media Handles: omega.teched megha_with megha-sharma24 OMega TechEd