Mapping cardinality (cardinality constraint) in ER MODEL

RUpaliLohar 1,285 views 36 slides Aug 10, 2020
Slide 1
Slide 1 of 36
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36

About This Presentation

Mapping cardinality (cardinality constraint) in ER MODEL


Slide Content

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

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.

Types of Mapping Cardinality Many-to-Many cardinality ( m:n ) Many-to-One cardinality (m:1) One-to-Many cardinality (1:n) One-to-One cardinality (1:1 )

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-

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.

A customer is connected with more than one loan using borrower and a loan is connected with more than one customer using borrower.

Example One student can enroll in at most one course. One course can be enrolled by any number (zero or more) of students.

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.

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-

Example One student can enroll in any number (zero or more) of courses. One course can be enrolled by at most one student.

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.

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-

Example One student can enroll in at most one course. One course can be enrolled by at most one student.

A customer is connected with only one loan using the relationship borrower and a loan is connected with only one customer using borrower.

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;

Participation Constraints- Participation constraints define the least number of relationship instances in which an entity must compulsorily participate.

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.

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.

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.

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.

Student management system

THANK YOU
Tags