ER Modeling
ER Modeling
ER MODELING
Instructor: SAMIA ARSHAD
ER Modeling
• Entity relationship model defines the conceptual view of
database.
• It works around real world entity and association among
them.
• It should be understandable to both the user and to the IT
technologist.
• It must be flexible enough so that it can be used and
understood in practically any environment where
information is modelled.
• At view level, ER model is considered well for designing
databases.
ER Modeling
• It is expressed in terms of entities in the
business environment, the relationships (or
associations) among those entities and the
attributes (properties) of both the entities and
their relationships
• The E-R model is usually expressed as an E-R
diagram
Entity
An entity is an object or concept about
which you want to store information.
e.g. person, place, object, event, concept.
Attribute
Characteristics of an entity
Relationship
Specify the relations among entities
Example
Entity Set
• Entity Set is a collection of entities that share
common properties or characteristics. Each
entity set is given a name, since this name
represents a set of items, it is always singular.
It is placed inside the box representing the
entity set.
Entity Types
Entities based on their characteristics are
classified as follows.
• Strong Entities
• Weak Entities
• Recursive Entities
• Composite Entities
• Strong Entity An entity set that has a primary key is
termed as strong entity set.
• Weak Entity An entity set that does not have sufficient
attributes to form a primary key is termed as a weak
entity set.
• Recursive Entity A recursive entity is one in which a
relation can exist between occurrences of the same entity
set. This occurs in a unary relationship.
• Composite Entities
If a Many to Many relationship exist we must create a
bridge entity to convert it into 1 to Many. Bridge entity
composed of the primary keys of each of the entities to
be connected. The bridge entity is known as a composite
entity. A composite entity is represented by a diamond
shape with in a rectangle in an ER Diagram.
Example of Weak and Strong entity
Attributes
• An attribute is a property or characteristic of an
entity type, for example the entity EMPLOYEE may
have attributes Employee_Name and
Employee_Address.
• In ER diagrams place attributes name in an ellipse
with a line connecting it to its associated entity
• Attributes may also be associated with relationships
• An attribute is associated with exactly one entity or
relationship
Attributes Types
In Entity Relationship(ER) Model attributes can
be classified into the following types.
• Simple and Composite Attribute
• Single Valued and Multi Valued attribute
• Stored and Derived Attributes
• Complex Attribute
Simple versus composite attributes
• Some attributes can be broken down into
meaningful component parts, such as Address,
which can be broken down into Street_Address,
City..etc.
• The component attributes may appear above or
below the composite attribute on an ER diagram
• Provide flexibility to users.
• A simple (atomic) attribute is one that cannot be
broken down into smaller components
A composite attribute
Single-Valued versus Multivalued Attribute