Entity-Relationship model
a model for identifying entities to be
represented in the database and representation
of how those entities are related.
Entity-Relationship model
 Design Phases - Requirement Analysis:
 to understand what data need to be stored in the
database, what applications must be built, what are
all those operations that are frequently used by the
system.
 requires proper communication with user groups.
Entity-Relationship model
 Design Phases – Conceptual database design:
 E-R Model is built.
 a high level model used in database design.
 to create a simple description of data that matches
with the requirements of users.
Entity-Relationship model
 Design Phases – Logical database design:
 ER model is converted to relational database
schema.
Design Phases – Schema refinement:
 to identify the potential problems and to refine it.
 normalizing and restructuring the relations.
Entity-Relationship model
 Design Phases – Physical database design:
 building indexes on tables and clustering tables,
redesigning some parts of schema obtained from
earlier design steps.
Entity-Relationship model
 Design Phases – Application and Security
Design:
 UML – design of the database can be accomplished.
 the role of each entity in every process must be
reflected in the application task.
 some access rules must be enforced on the application
to protect the security features.
ER Model - Concepts
 Entity Sets:
 Entity: a “thing” or “object” in the real world that is
distinguishable from all other objects.
 Example: a particular person, car, house, etc.
 An entity has set of properties, and the values for some set
of properties may uniquely identify an entity.
 An entity set is a collection of entities having the same
properties
ER Model - Concepts
Attributes:
 The properties that describe an entity are called
attributes.
 In the customer entity customer id, name, street
are the attributes
ER Model - Concepts
Attributes – Types:
 Simple attribute:
 An attribute that cannot be divided into further
subparts (atomic).
 Example: Customer-id of customer entity
ER Model - Concepts
Attributes – Types:
 Composite attribute:
 An attribute that can be divided into a set of
subparts. Employee
Address
Name
Salary
Number Street City
ER Model - Concepts
Attributes – Types:
 Single value attribute:
 An attribute having only one value in a particular
entity.
ER Model - Concepts
Attributes – Types:
 Multi-valued attribute:
 An attribute having more than one value for a
particular entity. Employee
Address
Name
Degrees
Number Street City
ER Model - Concepts
Attributes – Types:
Derived attribute:
 An attribute that is derived from other related
attributes or entities. Employee
Address
Birthdate
Age
Number Street City
ER Model - Concepts
 Relationship set:
 an association among several entities.
 a set of relationships of the same type.
ER Model
 Mapping Cardinality:
 the number of entities to which another entity can
be associated via a relationship set.
 For a binary relationship set R between entity sets
A and B
ER Model
 Mapping Cardinality - One-to-one (1 : 1)
 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.
 One-to-many (1 : M)
 An entity in A is associated with any number of entities in
B. An entity in B can be associated with at most one entity
in A.
ER Model
 Mapping Cardinality - Many-to-Many (M : N)
 An entity in A is associated with any number of entities in
B, and an entity in B is associated with any number of
entities in A.
 Many to one (M : 1)
An entity in A is associated with at most one entity in B. An
entity in B can be associated with any number of entities in
A.
ER Model
 Ternary relation:
 If a relationship connects three connects three
entities.
 Entities: Product, Supplier and customer
 Relationship: buy
ER Model
Weak Entity Set:
 Entity types that do not have key attributes of their
own are called weak entity types.
 Strong Entity Set:
 Entity types that have key attributes of their own
are called strong entity types
Components of ER Diagram
Component Description Symbol
Entity Rectangle
Relationship Diamond
Attributes for
any Entity Ellipse
Key Attribute
for any Entity
the attribute
name inside
the Ellipse is
underlined.
Components of ER Diagram
Component Description Symbol
Derived
Attribute for
any Entity
dotted
ellipse is
created
inside the
main ellipse
Multivalued
Attribute for
any Entity
Double
Ellipse
ER Diagram - Entity
Component Example Symbol
Entity
Employee,
Manager,
Department
Weak Entity
depends on
another
entity
ER Diagram - Attribute
Component Description Symbol
Attribute
(Name, Age,
Address)
property or
characteristic
of an entity
Key Attribute
main
characterstic
of an Entity
Composite
Attribute
have their
own attributes
ER Diagram - Relationship
Component Description Symbol
One to One
Relationship
one student can enroll
only for one course and
a course will also have
only one Student
One to Many
Relationship
1 student can opt for
many courses
Many to One
Relationship
Student enrolls for only
one Course but a
Course can have many
Students
ER Diagram - Relationship
Component Description Symbol
Many to Many
Relationship
one student can enroll
for more than one
courses. And a course
can have more than 1
student enrolled in it
ER Model

DBMS - ER Model

  • 1.
    Entity-Relationship model a modelfor identifying entities to be represented in the database and representation of how those entities are related.
  • 2.
    Entity-Relationship model  DesignPhases - Requirement Analysis:  to understand what data need to be stored in the database, what applications must be built, what are all those operations that are frequently used by the system.  requires proper communication with user groups.
  • 3.
    Entity-Relationship model  DesignPhases – Conceptual database design:  E-R Model is built.  a high level model used in database design.  to create a simple description of data that matches with the requirements of users.
  • 4.
    Entity-Relationship model  DesignPhases – Logical database design:  ER model is converted to relational database schema. Design Phases – Schema refinement:  to identify the potential problems and to refine it.  normalizing and restructuring the relations.
  • 5.
    Entity-Relationship model  DesignPhases – Physical database design:  building indexes on tables and clustering tables, redesigning some parts of schema obtained from earlier design steps.
  • 6.
    Entity-Relationship model  DesignPhases – Application and Security Design:  UML – design of the database can be accomplished.  the role of each entity in every process must be reflected in the application task.  some access rules must be enforced on the application to protect the security features.
  • 7.
    ER Model -Concepts  Entity Sets:  Entity: a “thing” or “object” in the real world that is distinguishable from all other objects.  Example: a particular person, car, house, etc.  An entity has set of properties, and the values for some set of properties may uniquely identify an entity.  An entity set is a collection of entities having the same properties
  • 8.
    ER Model -Concepts Attributes:  The properties that describe an entity are called attributes.  In the customer entity customer id, name, street are the attributes
  • 9.
    ER Model -Concepts Attributes – Types:  Simple attribute:  An attribute that cannot be divided into further subparts (atomic).  Example: Customer-id of customer entity
  • 10.
    ER Model -Concepts Attributes – Types:  Composite attribute:  An attribute that can be divided into a set of subparts. Employee Address Name Salary Number Street City
  • 11.
    ER Model -Concepts Attributes – Types:  Single value attribute:  An attribute having only one value in a particular entity.
  • 12.
    ER Model -Concepts Attributes – Types:  Multi-valued attribute:  An attribute having more than one value for a particular entity. Employee Address Name Degrees Number Street City
  • 13.
    ER Model -Concepts Attributes – Types: Derived attribute:  An attribute that is derived from other related attributes or entities. Employee Address Birthdate Age Number Street City
  • 14.
    ER Model -Concepts  Relationship set:  an association among several entities.  a set of relationships of the same type.
  • 15.
    ER Model  MappingCardinality:  the number of entities to which another entity can be associated via a relationship set.  For a binary relationship set R between entity sets A and B
  • 16.
    ER Model  MappingCardinality - One-to-one (1 : 1)  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.  One-to-many (1 : M)  An entity in A is associated with any number of entities in B. An entity in B can be associated with at most one entity in A.
  • 17.
    ER Model  MappingCardinality - Many-to-Many (M : N)  An entity in A is associated with any number of entities in B, and an entity in B is associated with any number of entities in A.  Many to one (M : 1) An entity in A is associated with at most one entity in B. An entity in B can be associated with any number of entities in A.
  • 18.
    ER Model  Ternaryrelation:  If a relationship connects three connects three entities.  Entities: Product, Supplier and customer  Relationship: buy
  • 19.
    ER Model Weak EntitySet:  Entity types that do not have key attributes of their own are called weak entity types.  Strong Entity Set:  Entity types that have key attributes of their own are called strong entity types
  • 20.
    Components of ERDiagram Component Description Symbol Entity Rectangle Relationship Diamond Attributes for any Entity Ellipse Key Attribute for any Entity the attribute name inside the Ellipse is underlined.
  • 21.
    Components of ERDiagram Component Description Symbol Derived Attribute for any Entity dotted ellipse is created inside the main ellipse Multivalued Attribute for any Entity Double Ellipse
  • 22.
    ER Diagram -Entity Component Example Symbol Entity Employee, Manager, Department Weak Entity depends on another entity
  • 23.
    ER Diagram -Attribute Component Description Symbol Attribute (Name, Age, Address) property or characteristic of an entity Key Attribute main characterstic of an Entity Composite Attribute have their own attributes
  • 24.
    ER Diagram -Relationship Component Description Symbol One to One Relationship one student can enroll only for one course and a course will also have only one Student One to Many Relationship 1 student can opt for many courses Many to One Relationship Student enrolls for only one Course but a Course can have many Students
  • 25.
    ER Diagram -Relationship Component Description Symbol Many to Many Relationship one student can enroll for more than one courses. And a course can have more than 1 student enrolled in it
  • 26.