Write a short note on Relationship within a data model. Discuss about Relationship within a data model
Relationship within a data model :-
A relationship is a mapping or linkage between two sets of data. It can be one-to-one, one-to-many, many-to-many.
1. One-to-one: An entity in A is associated with at most one entity in B and an entity in B is also associated with at most one entity in A.
Example: Between two entity set TEACHER and DEPARTMENT, considered the relationship HEAD-OFF. If we assumed that each department can have only one head an one person can not the HEAD-OFF more than one department, then the relationship HEAD-Off more than one department, then the relationship HEAD-OFF is one-to-one.
2. One-to-many:- An entity in A is associated with any number of entities in B. However an entity in B can be associated with all most one entity in A.
Example: At a given point of time, zero, one or many patients are assigned to one hospital room that is a hospital room may have zero, one or many patients but a patient is assigned to only one hospital room then the relationship between ‘hospital room’ and ‘patient’ is one-to-many.
-à An entity in A is associated with more than one entities in B. More than one entity in B can be associated with one entity in A.
3. Many-to-many:- An entity in A is associated with any number of entity in B and on entity in B is associated with any number of entities in A.
Example: A surgeon may have operated on several patients. A patient may have be operated on by several surgeons. Then the relationship ‘patient’ and ‘surgeon’ is many-to-many.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment