Вы находитесь на странице: 1из 3

Le c t e N ot sF rDBM S a nd Da t M ining a nd Da t W a r hous ng ur e o a a e i

Lecture 7 Extended E-R Features: ? Specialization: It is the process of identifying the subclass/es of an entity set which are special from other entities of this set in terms of attributes or relationships they make. Consider the design of a database for an academic institution. While designing we identified an entity set Employee which represent all the employees of this. The attributes of this may be (Employee ID, Employee Name, Date of Joining, Address) but then we see a subclass of this set of employees, called set of all Teachers which is different from other employees. We may have other employees in the sub classes called Admin Staff or Technical Lab Staff or Other Staff like peons and other workers. All of these subclasses form specialization of class Employee. All the attributes and associations of class Employee will also be there with all the subclasses. Every teacher will have an employee ID, Name, DOJ, Address similarly the admin staff, technical lab staff and other staff members. Sub classes may have some attributes or associations of their own which make them different from others. The Teachers will have a subject they teach, Department they belong to, Expertise they have. The teachers will have associations with different entities like Classes they teach in, Projects they guide etc. These attributes and associations will not be there with other employees sub sets ? Generalization: This is again a similar process as specialization but it is just opposite of that. It is the process of combining the subclasses into a general class and moving the common attributes and associations from subclasses to the general class. It is just the different practical approach. In specialization we start from the general classes and forms the special classes out of them while in generalization we start from various low level classes and forms the general classes by combining several of them identifying the common features in them. So in the above example of Academic Institute we may start thinking of Teachers as an Entity set and then Technical Lab Staff and Then Admin staff and then observing that they have several fields in common like Employee Id, name, Address etc. we combine them to define a general class Employee which will only those attributes which are common in all the above three classes. And then these classes will not have these common fields rather they will be there for all employees collectively in the general entity set Employee. ? The result of both the above process is same. We get a hierarchy of classes and subclasses which can be represented by a tree structure. The result of generalization and specialization will be like this.
Na e m EM P I D Em pl oyee IA S Addr s es DO J

T ea cher

Adm i S taf n f

La St f b af

O therS taf f

S ubj ect

Deptt.

R ol e

La N a e b m

Depatm ent ofEl ia a El onis r ectrc l nd ectr c

By:S ul bh Ba a a nsl

Le c t e N ot sF rDBM S a nd Da t M ining a nd Da t W a r hous ng ur e o a a e i

? Aggregation: Consider a Borrower relationship set that associates customers from Customer entity set to the loans they borrowed in entity set Loan. Suppose the bank decides to attach an employee to some customer-loan relationships of Borrower based on probably the size of loan or status of customer. This employee called the loan officer will be responsible for tracking up and following up the status of the loan time to time. This suggests a relationship that exists between Customer, Borrower and Employee. So we can draw the simple ERD as follows:
Cus na e t- m L oa N um ber n

Cus I t-D

Cus er tom

Borow er r

L oa n
A m ount

Addr s es

L oa ofi n- fcer Em pl oyee


Em p-D I Em p- m e na Addr s es

o The diagram above may imply that the relationships Borrower and Loan-Officer may be combined into one. But then it will require that a loan-officer must be combined to every Customer-loan pair, which is not true. o The above diagram also have redundancy as every customer-loan pair in Loanofficer is also in Borrower. ? More appropriate way of representing the above set of relationships would be to consider the entire relationship Borrower with its associated entities Customer and Loan as an entity i.e. an aggregate entity, and then representing relationship Loan-Officer between the entities Employee and the above aggregated entity. As follows:
Cus na e t- m Cus I t-D Addr s es L oa N um ber n

Cus er tom

Borow er r

L oa n
A m ount

L oa ofi n- fcer Em pl oyee


Em p-D I Em p- m e na Addr s es

Depatm ent ofEl ia a El onis r ectrc l nd ectr c

By:S ul bh Ba a a nsl

Le c t e N ot sF rDBM S a nd Da t M ining a nd Da t W a r hous ng ur e o a a e i

? Important Terms related to generalization and specialization: o Attribute inheritance: All the attributes of higher level entity sets are inherited by the respective lower level entity sets. Also the relationships in which higher level entity sets participates all the respective lower level entity level entity sets also participates. o Disjoint: The lower level entity sets corresponding to a higher level entity sets are called disjoint if an entity doesn belong to more than one lower level entity sets. t o Overlapping: When the same entity may belong to more than one lower level entity set. o Complete Generalization: When each higher level entity belongs to at least one lower-level entity set. o Partial Generalization: When some higher-level entities may not belong to any lower-level entity set.

Depatm ent ofEl ia a El onis r ectrc l nd ectr c

By:S ul bh Ba a a nsl

Вам также может понравиться