Information Modeling By means of Entity Relationship (ER) Method Part – 8
Creating the Simple Scheme
As soon as the entities as well as associations have been recognized as well as demarcated, the first (1st) draft of the Entity Relationship (ER) diagram can be formed. This portion of the article will present the Entity Relationship (ER) diagram by means of representing by what method to draw the binary relations. Recursive relations are presented in the latter part of this portion too.
Binary Relationships
In binary relations there are three (3) types of relations, like One to One (1 to 1), One to Many (1 to N), and Many to Many (N to N). The following section explains these three (3) types of relation in details.
One to One (1 to 1)
The below diagram displays an instance of a One to One (1 to 1) relation diagram. Understanding the figure from left to right signifies the association that every single patient is allotted to a nurse. For the reason that every single patient should have a nurse, the sign for compulsory presence, in this particular situation the crossbar ( | ) is positioned next to the NURSE entity. Understanding from right to left, the figure displays that not every nurse are allotted to patients. This situation may imitate that a number of nurses are reserved for an emergency situations. Consequently, the sign for non-compulsory presence which in this case is the circle ( O ) is placed next to the PATIENT entity. The cardinality as well as existence of an association should be derived from the "professional rules" of the organization. For an instance, if every nurse possessed by the hospital were allotted to patients, then the circle ( O ), which is the sign for non-compulsory presence should be substituted by a crossbar ( | ) to show compulsory presence. One to One (1 to 1) relations hardly occurs in the "real-world" information models. A number of specialists recommend that most One to One (1 to 1) relations must be bent into a sole entity or else changed to a generalization hierarchy.
Every patient is allotted to one nurse, not all nurse are allotted to patients.
One to Many (1 to N)
The below diagram displays an instance of One to Many (1 to N) relation diagram between DOCTOR and NURSE. In this figure, DOCTOR is reflected as the parental entity while on the other hand the NURSE is the child entity. Understanding from left to right, the figure signifies that doctors may possibly be accountable for numerous nurses. The possibility of the association imitates the "professional rule" that not every doctors in the hospital will be in charge for handling nurses. Understanding from right to left, the figure signifies that every single nurse should be the accountability of precisely one (1) doctor.
Many to Many (N to N)
The below diagram displays an instance of a Many to Many (N to N) relation diagram between STUDENT and SUBJECT. A student may possibly be allotted to numerous subjects; every single subject should have several students. Note that the relationship among STUDENT and SUBJECT is noncompulsory for the reason that, at a given point of time, a student may possibly not be allotted to any subject. On the other hand, the association between SUBJECT and STUDENT is compulsory since a subject should have more than one (1) students allotted to it. Many to Many (N to N) relations can be castoff in the early drafting of the model however ultimately should be converted into two (2) One to Many (1 to N) relations. The alteration is essential for the reason that Many to Many (N to N) relations cannot be signified by means of the relational model.
Recursive Relations
A recursive association is an entity which is related with it. The below diagram illustrates an instance of the recursive relationship.
A doctor may possibly supervise many (N) junior doctors as well as each doctor is supervised by one (1) doctor.
This is the last part of the “Information Modeling By means of Entity Relationship (ER) Method” series.