You are on page 1of 18

THE ENTITY RELATIONSHIP MODEL

FACULTY : MR.S.P.SINGH

SALONI NANDA BBA 4519/09 NIHARIKA CHUGH BBA 4547/09

The Entity-Relationship Model


The E-R model is a detailed, logical representation of the data for an organisation or business area It was introduced by Clum in 1974; The ER model is collection of object of similar structures called an entity set The model must be as open as possible and not tied to any technology or to any particular business methodology It must be flexible enough so that it can be used and understood in practically any environment where information is modelled. The relationship between entity sets is represented on the basis of no

of entities of another set such as


1. one to one(1:1), 2. one to many(1:n), 3. many to one(n:1).

ER- Model Basics


Entity:
1. Real-world object distinguishable from other objects.
2. An entity is described (in DB) using a set of attributes 3. An entity has a set of properties that may uniquely identify an entity

4. An entity may be concrete such as person or a book, or it may be abstract such as a loan, a holiday etc.

Entity Set:
A collection of similar entities that share same properties. E.g., all employees.

Each entity set has a key. Each attribute has a domain.

ER Model Basics
Relationship: Association among two or more entities.

Relationship Set: Collection of similar relationships.


1.

An relationship set R relates n entity sets E1 ... En; each relationship in R involves entities e1, ..., en

2.

Same entity set could participate in different relationship sets, or in different roles they describe Attributes:in same set. the entity and relationship. Each such attribute is with a value set and can take a value from this value set.

MAPPING CARDINALITIES:
It is also known as Cardinality ratios It expresses the number of entities to which another entity can be associated via a relationship sets. For a binary relation R between entity sets A & B, The mapping cardinalities must be one of the following: 1. one to one: -An entity in A is associated with at most one entity in B, and an entity in B is associated with at most one entity in A.

1-to-1

2.

One to many :
An entity in A is associated with any number ( zero or more ) of entities in B. An entity. In B however can be associated with at most one entity in A.

1-to Many

A
3. Many to one: An entity in A is associated with at most one entity in B An entity in B, however can be associated with any number of entities in A.

Many-to-1

4.

Many to many:

An entity in A is associated with any number of entities of B, and an entity in B is associated with any number of entities in A.

Many-to-Many

E-R Model Constructs


Entity Type - is a collection of entities that share common properties or characteristics. Each entity type 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 type. Entity - person, place, object, event, concept. Entity instance is a single occurrence of an entity type. An entity type is described just once (using metadata) in a database, while many instances of that entity type may be represented by data stored in the database. e.g. there is one EMPLOYEE entity type in most organizations, but there may be hundreds of instances of this entity stored in the database.

E-R DIAGRAMS

The ER diagram can express the overall logical structure of a database graphically.

LAYOUT OF E-R DIAGRAM

Example of a E-R diagram

ADVANTAGES OF E-R DIAGRAMS:


It is a straight forward relation and is modern.
easy conversion from E R to other data models can be done. graphical representation for better understanding. They are very simple and clear.

Weak Entities

Example of a weak entity

E-R SPECIALIZATION
Top-down design process: we designate sub groupings within an entity set that are distinctive from other entities in the set.

These sub groupings become lower-level entity sets that have attributes or participate in relationships that do not apply to the higher-level entity set.
Depicted by a triangle component labeled ISA (E.g. customer is a person). Attribute inheritance a lower-level entity set inherits all the attributes and relationship participation of the higher-level entity set to which it is linked.

E-R GENERALIZATION
Sometimes there are similarities between the customer entity set and the employee entity set i.e. they have some attributes in common;
This commonality can be expressed by Generalization; It is a containment relation which is a containment relationship that exists a higher level entity set and one or more lower level entity sets; generalization is a simple inversion of specialization; it proceeds from the recognition of that number of entity sets that share common features.

ER SPECIALIZATION DIAGRAM

You might also like