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

Enhanced ER Model

Group 5edit Master subtitle style Click to : Saqib Ahmed Abdul-Ahad Mirza Waqas Ali Khan 09-4022 09-4027 09-4287

5/22/12

OUTLINE
History of EER Model Entity Relationship Entity Relationship Model Components of EER

5/22/12

Definition
The enhanced entity-relationship (EER) model is a high-level or conceptual data model incorporating extensions to the original entityrelationship *(ER) model, used in the design of databases.

5/22/12

History of EER Model


1970s:

Chen introduced the Entity Relationship (ER) data model. This was basically used for the diagrammatic representation of entities and relationships among entities in the subject domain.

5/22/12

History of EER Model (cont.)


1980s o Many Computer Scientists worked to extend the ER

Model devised by Peter Chen.

o There has been an increase in emergence of new

database applications with more demanding requirements.

5/22/12

History of EER Model (cont.)


the new complex applications.

o Basic Concepts of ER Model were not enough for

o As a results, development of additional semantic

modelling concepts took place.


o Extensions made by different people generates the

Enhanced ER Model and it can be summed up as, EER model = ER Model + hierarchical relationships
5/22/12

Entity Relationship
Entity is something that exists by its self, in database we can say any kind of data is entity. An abstract and conceptual representation of data is called Entity Relationship.

5/22/12

Entity Relationship Model


It use the three level approach.
o Conceptual Model:

Defines the most common data entities which are to be used.


o Logical Model:

Along with main data entities, operational and transactional data entities are also described.
o Physical Model:

In this layer the structural metadata* is instantiate into DBMS in the form of tables, keys 5/22/12

Basic Elements of ER Model


Entity:

Anentitymay be defined as a thing which is recognized as being capable of an independent existence and which can be uniquely identified.
Relationship:

It describes the method through which entities are related with each other. They are usually represented as verbs. 5/22/12

Basic Elements of ER Model (Cont.)


Attributes:

The properties of either entities or relations are known as their attributes. Through attributes we can distinguish different values.
Cardinality:

Thecardinalityof one data table with respect to another table describes the 5/22/12 relationships between them and explains how

Symbols of ER Diagram

5/22/12

Symbols of ER Diagram (cont.)

5/22/12

An Example of ER Modeling
Statement:
A library database contains a listing of authors that have written books on various subjects (one author per book). It also contains information about libraries that carry books on various subjects.

5/22/12

An Example of ER Modeling (cont.)


Entity Sets:

authors, subjects, books, libraries


Relationship Sets:

wrote, carry, indexed

5/22/12

An Example of ER Modeling (cont.)


ER Diagram:

5/22/12

Keys
Entities and relationships are distinguishable using

various keys.

Definition:

A key is a combination of one or more attributes, e.g., social-security number, combination of name and social-security number.
5/22/12

Keys (cont.)
Super Key:

It is defined either for an entity set or relationship set that uniquely identifies an entity.
Candidate Key:

It is a minimal super key that uniquely identifies either an entity or a relationship.


5/22/12 Primary Key:

ER to EER
Some additional concepts make EER

different.

New concepts includes:


Sub class Super class Specialization Generalization Union of different entities, etc.

5/22/12

ER to EER (cont.)
It is used to model applications more

completely

and accurately.
It includes some object-oriented concepts,

such

as inheritance.
5/22/12

Rules for Insertion and Deletion

Deleting an entity from a super class meant

that it is automatically deleted from all of the belonging subclasses.

Inserting an entity in a super class implies

that the entity is inserted in all predicatedefined subclasses for which the entity satisfies the defining predicate.

5/22/12

Rules for Insertion and Deletion (cont.)


Inserting an entity in a super class of total

specialization implies that the entity is inserted in at least one of the subclasses of the specialization.

Inserting an entity in a super class of disjoint,

total specialization implies that the entity is inserted in one and only one of the subclasses of the specialization.

5/22/12

Subclass
Suppose we have two entity types X and Y,

and if every entity of Y is in entity type X then we can say Y is subclass of X.


N.i.c }

v X={name, roll number, gender, age, cgpa, v Y={name, gender, age, cgpa}

So from above example we can see very

clearly that Y is subclass of X.

5/22/12

Sub class (cont.)


Example: EMPLOYEE may be further grouped into

SECRETARY, ENGINEER, MANAGER, TECHNICIAN, SALARIED_EMPLOYEE, HOURLY_EMPLOYEE,

Each of these groupings is a subset of EMPLOYEE entities Each is called a subclass of EMPLOYEE

5/22/12

Super class
The super class is the entity type from which

other entity types inherit some attributes.

In previous example X entity type was super

class .

An other example can be a Bikes entity

type.
5/22/12

Super class (cont.)


Example: EMPLOYEE may be further grouped into

SECRETARY, ENGINEER, MANAGER, TECHNICIAN, SALARIED_EMPLOYEE, HOURLY_EMPLOYEE,

EMPLOYEE is the super class for each of these subclasses

5/22/12

Specialization
Specialization is basically separation of the

tasks with in a system.

By this process we can easily determine the

different portions and tasks of a complete system.

5/22/12

Specialization (cont.)
If all subclasses in a specialization have

membership condition on same attribute of the superclass, specialization is called an attribute-defined specialization.

5/22/12

Specialization (cont.)

5/22/12

Specialization (cont.)
Example:

{SECRETARY, ENGINEER, TECHNICIAN} is a specialization of EMPLOYEE based upon job type. {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE} is another specialization of EMPLOYEE based in method of pay.

5/22/12

Generalization
It is an extension of a concept of less specific

area.

We basically generalize all the entity types

under one very generic entity type.

Example can be Animal:

An animal can be said to be the 5/22/12 generalized form of mammals, birds,

Generalization and Specialization


reverse of each other.
Example:

Generalization and Specialization are

CAR, TRUCK generalized into VEHICLE; both CAR, TRUCK become subclasses of the super class VEHICLE.
{CAR, TRUCK} can be viewed as a specialization of

VEHICLE
Alternatively, VEHICLE can be viewed as a generalization

of CAR and TRUCK


5/22/12

Generalization and Specialization (cont.)


There are two kinds of subclasses:
1. Predicate-defined (or condition-defined) 2. User-defined

If we can determine exactly those entities

that will become members of each subclass by a condition, the subclasses are called predicate-defined (or condition-defined) subclasses
5/22/12

Generalization and Specialization (cont.)


In an EER diagram predicate-defined subclass

is shown by writing the predicate condition next to the line attaching the subclass to its super class.

User-defined subclass is where the user

specifies subclass membership individually.

5/22/12

Constraints on Generalization and Specialization are: Two basic types of constraint

Disjointness Constraint
1. 2.

Disjoint Overlapping

Completeness Constraint:
1. Total 2. Partial
5/22/12

Constraints on Generalization and Specialization (cont.) Disjointness Constraint


If it is disjoint it is represented by d in EER

diagram.

Disjoint basically means that an entity can be a member of at most one of the subclasses of the specialization.

If it is not disjoint then it is overlapping and

represented by o in EER diagram.

Overlapping basically means that the same entity 5/22/12 may be a member of more than one subclass of the

Example of Disjoint Specialization

5/22/12

Example of Overlapping Specialization

5/22/12

Constraints on Generalization and Specialization Completeness Constraint (cont.)


A total specialization constraint specifies that

that every entity in the superclass must be a member of at least one subclass in the specialization

Total specialization is represented by double lines in EER diagram.

A partial specialization constraint allows an entity not

to belong to any of the subclasses.


5/22/12 Partial specialization is represented by single line in EER

Constraints on Generalization and Specialization (cont.) Therefore we have four we have four types of
specialization/generalization:
1. Disjoint, total 2. Disjoint, partial 3. Overlapping, total 4. Overlapping, partial

Note: Generalization usually is total because

the superclass is derived from the 5/22/12 subclasses.

Example of Total & Disjoint Constraint

5/22/12

Example of Partial & Disjoint Constraint

5/22/12

Example of Total & Overlapping Constraint

5/22/12

Specialization and Generalization Hierarchies and A subclass itself may have further subclasses Latticesforming a hierarchy or a lattice specified on it,
of specializations.
Hierarchy is basically a constraint that each

subclass has exactly one superclass(called single inheritance).

In a lattice, a subclass will have more than


5/22/12

one parent( called multiple heritance).

Shared Subclasses
A subclass inherits the attributes not only of

its direct superclass but also of all its predecessor superclasses all the way to the root of the hierarchy or lattice.

A subclass with more than one superclass is

called a shared subclass.


The rule states that if an attribute (or
5/22/12

relationship) originating in the same superclass is inherited more than once via

Example of Shared Subclass

5/22/12

Utilizing Specialization and Generalization in Refining Conceptual Schemas Top-down conceptual refinement process:
We typically start with an entity type and then

define subclasses of the entity type by successive specialization.

Bottom-up conceptual synthesis:


We typically start with many entity types and

generalize those that have common properties.


5/22/12 In practice, a combination of both processes is

Category(Union)
Union is the term in which we unite different

entity types in one.

To represent a collection of objects that is the

union of objects of different entity types.

5/22/12

Category(Union) (cont.)
The need arises for modeling a single

superclass/subclass relationship with more than one superclass, where the superclasses represent different entity types.

A category has two or more superclasses that

may represent distinct entity types, whereas other superclass/subclass relationships always have a single superclass.
5/22/12

Category(Union) (cont.)
In category the subclass may or may not have

the same attributes as of its superclasses.

The superclasses are connected to the circle

with the U symbol, which stands for the set union operation.

5/22/12

Example of Category(Union)

5/22/12

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