Mapping Cardinalities (Dependencies) in DBMS
Mapping Cardinalities (Dependencies)
Cardinality defines the number
of entities of one entity set, which are associated or join with the number of
entities of another set via a relationship set.One-to-one –
- one student can enroll only for one course and a course will also have only one Student.
·
It is represented by adding ‘1’ near the
entities on the line joining the relation.
·
In another type of notation one dash is added
to the relationship line at both ends.
One-to-many –
·
One entity from entity set A can be
associated with more than one entity of entity set B.
·
A one-to-many relationship is represented by
adding ‘1’ near the entity at the left-hand side of the relation and ‘N’ is written
near the entity on the right side.
· another type of notation will have a dash at LHS
of relation and three arrow kind of lines at the RHS of relation as shown
below.
1 student can opt for many courses,
· Many-to-one –
o
More than one entity 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.
Student enrolls for only one Course
but a Course can have many Students
·
Many-to-many –
o
One entity from A can be associated with more
than one entity from B and vice versa.
one student can enroll in more than
one course. And a course can have more than 1 student
· A one-to-many relationship is represented by adding ‘M’ near the entity at the left-hand side of the relation and ‘N’ is written near the entity on the right side.
· another type of notation will have three arrow
kinds of lines at both sides of relation as shown below.
=================================================
0 Comments