Let we understand why this extended feature is needed. We know ER model is used to represent any database in pictorial view so that we can easily understand all about data but it is convenient if the data is not big or complex. But when the data become more complex than than we need to extend some feature in ER model.
For the improvement of existing ER model three new feature are added such as
For the improvement of existing ER model three new feature are added such as
- Specialization
- Generalization
- Aggregation
Specialization
An entity set may include sub grouping of entities or we can say that broken down into sub-entities that are distinct in some way from other entities in the set.A subset of entities with in entity set may have attribute that are not shared by all the entity in entity set.It is a top-down approach based on the specific attribute of the entity type with in given entity type.
Consider an entity set person with attribute Name,Age,Address,contact. Now a person may be further classified as one of the following.
- TEACHER
- STUDENT
Each of these person is described by a set of attribute that include all the attribute of entity set person plus possible additional attributes for example Teacher and student entities may be describe further by the attribute such as teacher-id,salary and student-id respectively. The process of designating sub grouping within a entity set is called specialization. The specialization of person according to whether they are teacher or student.
By using specialization we reduce redundancy fro example here a PERSON is sub grouping into two other entity set TEACHER and STUDENT. a PERSON contain its personal details as a attribute if the PERSON is a TEACHER than the personal detail of TEACHER is also the attribute of TEACHER.But in the case of specialization we have no need to repeat the personal detail of TEACHER entity set because TEACHER is a person and a personal detail of PERSON is given in PERSON entity set. In this way by using specialization redundancy will reduce.In specialization we create more than one entity set for a single entity.
By using specialization we reduce redundancy fro example here a PERSON is sub grouping into two other entity set TEACHER and STUDENT. a PERSON contain its personal details as a attribute if the PERSON is a TEACHER than the personal detail of TEACHER is also the attribute of TEACHER.But in the case of specialization we have no need to repeat the personal detail of TEACHER entity set because TEACHER is a person and a personal detail of PERSON is given in PERSON entity set. In this way by using specialization redundancy will reduce.In specialization we create more than one entity set for a single entity.
Generalization
Generalization is a bottom-up approach in which multiple entity set combined into a higher level entity set on the basis of common features.The database designer may have first identify a TEACHER entity set with attribute TEACHER-NAME,AGE,CONTACT,ADDRESS,TEACHER-ID,SALARY,DESIG. and STUDENT entity set with the attribute NAME,AGE,CONTACT,ADDRESS,STUDENT-ID,COURSE.
There are some similarity between both entity set with respect to attribute.These common type of attribute can be expressed by generalization which show relationship between higher level entity set and one or more lower level entity set.
In this example the higher level entity set is PERSON and lower level entity set are TEACHER and STUDENT.Higher level entity set is a super class and lower level entity set is sub class such as PERSON supper class and TEACHER and STUDENT are sub class.
Generalization proceed from the recognizance that a number of entity set share some common feature such as personal details.On the basis of common features the generalization combine these entity set into a single higher level entity set. Generalization show the similarity among higher level entity set and hide the differences.It is also take care that shared attribute are not repeated.
There are some similarity between both entity set with respect to attribute.These common type of attribute can be expressed by generalization which show relationship between higher level entity set and one or more lower level entity set.
In this example the higher level entity set is PERSON and lower level entity set are TEACHER and STUDENT.Higher level entity set is a super class and lower level entity set is sub class such as PERSON supper class and TEACHER and STUDENT are sub class.
Generalization proceed from the recognizance that a number of entity set share some common feature such as personal details.On the basis of common features the generalization combine these entity set into a single higher level entity set. Generalization show the similarity among higher level entity set and hide the differences.It is also take care that shared attribute are not repeated.
Constraints on Generalization
- User Define or Condition Define
Condition Define:We distribute the entity after checking one condition.
for example assume highet level entity set student has attribute set student has attribute marks and the lower level entity are pass & fail.
we valuate the student after checking condition.Suppose condition is if marks is greater than 40 than student is pass and if marks is less than 40 than student is fail.
User Define:In user define there is no checking condition such as,
- Total or Partial
Total:Each higher level entity belong to a lower level entity.
here Suppose we have three student records such as x,y,z
x 41 y 45 z 31
student x & y are pass and student z become fail.
Partial:Some higher level entity may not belongs to lower level entiry such as
Suppose we have marks of the studentx 41 y WH (with haled) z 45
here x will pass
z also pass
But in the case of y its marks is not derived because it is with haled
So this y which is one of higher level entity is not belong to lower level entities. - Disjoint or Overlapped
Disjoint:In disjoint constraint higher entity set are not belong to more than one entity set.
No student are both fail and pass, so it is disjoint constraint because student is either pass or fail.It belong to only one lower level entity.
Overlapped:In overlapped constraint some higher level entity belongs to more than one lower level entity such asx Teacher y Teacher & Student both z Student
here the high level entity are person which is (x, y, z)
x-> belongs to teacher
z-> belong to student
But y-> belong to both teacher and student so the y (high level entity) belongs to more than one lower level entity (Teacher, Student)
So we say this is overlapped.
Aggregation
One of the major problem of ER-model is that it is not possible to express the relationship among relationship. If we say in ER-diagram we can not have line from relationship diagonal box to another diagonal box.
So for solving this problem, we use the concept of aggregation.
For example
We have two entity set Doctor & Patient such as
If we want to relate new entity nurse with doctor-patient relationship than
One way is that nurse relate to both doctor and patient separately such as
But in this case redundancy is increasing.
So the another approach is aggregation.
In this approach first we make a abstract entity set than we relate with new entity set such as Nurse such as
So for solving this problem, we use the concept of aggregation.
For example
We have two entity set Doctor & Patient such as
If we want to relate new entity nurse with doctor-patient relationship than
One way is that nurse relate to both doctor and patient separately such as
But in this case redundancy is increasing.
So the another approach is aggregation.
In this approach first we make a abstract entity set than we relate with new entity set such as Nurse such as
No comments:
Post a Comment