VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
Mapping cardinality (cardinality constraint) in ER MODEL
1. Mapping Cardinality
(cardinality constraint) in E-R
Model
Asst.Prof. Rupali Lohar
Dept. of Computer Science & Engineering
B. R. Harne College Of Engineering & Technology, Karav, Post Vangani (W Tal Ambernath,
Mumbai, Maharashtra 421503
2. Mapping cardinality
• A mapping cardinality is a data constraint that specifies how many
entities an entity can be related to in a relationship set.
• It represents the number of entities of another entity set
which are connected to an entity using a relationship set.
• It is most useful in describing binary relationship sets.
5. 1. Many-to-Many Cardinality-
• By this cardinality constraint,
• An entity in set A can be associated with any number (zero or more)
of entities in set B.
• An entity in set B can be associated with any number (zero or more)
of entities in set A.
• Symbol Used-
6. Example-
• Here,
• One student can enroll in any number (zero or more) of courses.
• One course can be enrolled by any number (zero or more) of
students.
7. A customer is connected with more than one loan using
borrower and a loan is connected with more than one
customer using borrower.
8.
9. Example
• One student can enroll in at most one course.
• One course can be enrolled by any number (zero or more) of
students.
10. n a many-to-one relationship a loan is connected with more than one customer
using borrower and a customer is connected with only one loan using borrower.
11. 3. One-to-Many Cardinality-
• By this cardinality constraint,
• An entity in set A can be associated with any number (zero or more)
of entities in set B.
• An entity in set B can be associated with at most one entity in set A.
• Symbol Used-
12. Example
• One student can enroll in any number (zero or more) of courses.
• One course can be enrolled by at most one student.
13. In the one-to-many relationship a loan is connected with only
one customer using borrower and a customer is connected with
more than one loans using borrower.
14. One-to-One Cardinality-
• By this cardinality constraint,
• An entity in set A can be associated with at most one entity in set B.
• An entity in set B can be associated with at most one entity in set A.
• Symbol Used-
•
15. Example
• One student can enroll in at most one course.
• One course can be enrolled by at most one student.
16. A customer is connected with only one loan using the relationship
borrower and a loan is connected with only one customer using
borrower.
17.
18.
19.
20.
21. Degree of relationship
• Degree of relationship is the number of entity sets that are
participated (associated) in that relationship. That is, the number of
entity sets that are connected through the relationship is called the
degree of relationship.
• Based on the degree, the relationships may be identified as
• unary (degree 1),
• binary (degree 2),
• ternary (degree 3) and so on.
• Below given the ER diagram that shows the degrees of relationships;
25. Total Participation-
Each entity is involved in the relationship. Total participation is
represented by double lines.
• It specifies that each entity in the entity set must compulsorily
participate in at least one relationship instance in that relationship
set.
• Total participation is represented using a double line between the
entity set and relationship set.
26. • Double line between the entity set “Student” and relationship set
“Enrolled in” signifies total participation.
• It specifies that each student must be enrolled in at least one course.
•
27.
28. • Single line between the entity set “Course” and relationship set
“Enrolled in” signifies partial participation.
• It specifies that there might exist some courses for which no
enrollments are made.
29. • For example: Consider two entities Employee and Department and
they are related to each other via Manages relationship. An Employee
must manage a Department, he or she could be the head of the
department. But not every Employee in the company manages the
department. So, participation of employee in the Manages
relationship type is partial i.e. only a particular set of Employees will
manage the Department but not all.