DBMS-Introduction to DBMS-1.5-Cardinality-SPPU

 Cardinality In DBMS:

In Database Management System the term 'Cardinality' refers to the uniqueness of data values contained in a column.

If the column contains a large percentage of totally unique values then it is considered as high cardinality while if the column contains a lot of

"repeats" in its data range, it is known as Low cardinality.

Sometimes cardinality also refers to the relationships between tables. Cardinality. The cardinality between tables can be one-to-one,, many-to-one, or many­ to-many.

A relationship where two entities are participating is called a binary relationship.

Mapping Cardinality:

Mapping cardinality expresses the number of entities with which another entity can be associated in a relationship set.

It defines the relationship between two entities via a relationship set. Consider in a binary relationship set R (relation) between the entity of set A and set B. For this relationship mapping cardinalities are as Follows :

One to One

An entity of entity-set A can be associated with at most one entity of entity-set B and vice versa which means an entity in entity-set B can be associated with at most one entity of entity-set A.

Exampal ·: In the following example, One state has only one capital.

 

1-18 Introduction to DBMS

(a)

Example: In the following  example, many students can enroll in one school.

(a)One to Many 

 (b)Many to Many

 - In this type an entity. in set A is associated with - many other entities in set B.

But an entity in entity set B can be associated with a maximum of one entity in  the  entity set A.

 In this type, any entity in entity set A is associated with several entities in entity set B.

 

Example: In the following following the real seve, real a  example one can teach many students. /

(a)

- An entity in entity set B is associated with several entities in set entity A.

- Example: Many students learn many subjects.

 

Many to One

The appropriate mapping cardinality for  a particular relationship set is depending upon the real

_ In this type an entity in set A is associated with at most one entity in set B. And an entity in set B can be associated with several entities in set A. world situation to which the relationship set is modeling.

i. Total Participation: The participation of an entity set E in a relationship set R is said to be total if every entity in E participates in at least one relationship in R.

ii. Partial Participation: The participation of an entity set E in a relationship set R is said to be partial if only some entities in E participate in relationships in R.

0 For example, in a college database system, consider teachers are assigned as project guides to ::: every student. In this case, every Student entity is related to the teacher entity through the relationship "Guide".

0 Hence participation of the students in the relationship guidance is total. But not every teacher needs to guide the students.

0 Hence it is possible that not all the teacher entities are related to the student through the relationship "Guide". Here /the participation of teachers in the "guide" relationship set is partial.


Comments