ER Models
Presented By:-
Raj Kumar Verma
M.C.A.(L) Ist Sem
1.Introduction
2.Design Issue
3.Mapping Constraint
4.Keys
5.ER diagram
6.Weak And Strong entity sets
Content
Introduction
➢The entity-relationship(E-R) data model was develop to
facilitate database design by allowing specification of an
enterprise schema that represents the overall logical structure
of a database:
➢ The ER data model employees three basic concepts:
1)Entity Set
2)Relationship Set and,
3)Attributes
Entity Set
 A database can be modeled as:
1. A collection of entities,
2. Relationship among entities.
 An entity is an object that exist and is distinguishable from
other objects.
Example: Specific person , company, event, plant
 Entity have attributes
Example: People have name and address
 An entity set is a set of entities of the same type that share
same properties .
Example : set of all persons, companies, trees, holidays
Relationship set
 A relation is an association among several entities
 In above example we can see there are two entities instructor and student
 In the example instructor provide instructions to the student
Attributes
➢ An attribute of an entity set is a function that maps from the entity set
into a domain.
➢ Domain: the set of permitted values for each attribute.
➢ Attribute Type:
1. Simple and composite attributes
2. Single-valued and multi-valued attributes.
Example: Multivalued attributes: phone no.
3.Derived Attributes
Can be computed from other attributes
E.G. age, given date of birth
Mapping Constraint
➢ Mapping cardinalities, or cardinality ratio, express the number
of entities to which another entity can be associated via a
relationship set.
➢ For a binary relationship set the mapping cardinality must be
one of the following types:
1.One-to-one
2.One-to-many
3.Many-to-one
4.Many-to-many
One-to-one
➢ An entity is A, is associated with at most one entity in B, and entity B is
associated with at most one entity in A.
Example:-
One-to-many
➢ An entity is 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.
Example:-
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 at most one entity in
any number(Zero or more) of entities in A.
Example:-
Many-to-many
➢ An entity in A is associated with any number(Zero or more) of
entities in B. And an entity in B is associated with at most one entity
in any number (Zero or more) of entities in A.
Example:-
Keys
 We must have a way to specify how entities within a given set are
distinguished.
 Keys are very important part of Relational database model. They
are used to establish and identify relationships between tables and
also to uniquely identify any record or row of data inside a table.
Primary key
➢ Primary key is a candidate key that is most appropriate to become
the main key for any table. It is a key that can uniquely identify
each record in a table.
Candidate Key
 Candidate keys are defined as the minimal set of fields which can
uniquely identify each record in a table. It is an attribute or a set of
attributes that can act as a Primary Key for a table to uniquely
identify each record in that table.
Super Key
Foreign Key
 A Foreign ket in one table points to a primary key in another table
 A foreign kay can have a different name than the primary key it comes
from.
 The primary key used by a foreign key is also known as a parent key.
 Foreign key value can be null, even though primary key value can’t
 Foreign key don’t have to be unique in fact, they often aren’t
ER Diagram
➢ An entity relationship diagram (ERD), also known as an entity
relationship model, is a graphical representation of an information
system that depicts the relationships among people, objects, places,
concepts or events within that system.
Weak and Strong entity
Example:-
Thank You!

Er model

  • 1.
    ER Models Presented By:- RajKumar Verma M.C.A.(L) Ist Sem
  • 2.
    1.Introduction 2.Design Issue 3.Mapping Constraint 4.Keys 5.ERdiagram 6.Weak And Strong entity sets Content
  • 3.
    Introduction ➢The entity-relationship(E-R) datamodel was develop to facilitate database design by allowing specification of an enterprise schema that represents the overall logical structure of a database: ➢ The ER data model employees three basic concepts: 1)Entity Set 2)Relationship Set and, 3)Attributes
  • 4.
    Entity Set  Adatabase can be modeled as: 1. A collection of entities, 2. Relationship among entities.  An entity is an object that exist and is distinguishable from other objects. Example: Specific person , company, event, plant  Entity have attributes Example: People have name and address  An entity set is a set of entities of the same type that share same properties . Example : set of all persons, companies, trees, holidays
  • 6.
    Relationship set  Arelation is an association among several entities  In above example we can see there are two entities instructor and student  In the example instructor provide instructions to the student
  • 7.
    Attributes ➢ An attributeof an entity set is a function that maps from the entity set into a domain. ➢ Domain: the set of permitted values for each attribute. ➢ Attribute Type: 1. Simple and composite attributes 2. Single-valued and multi-valued attributes. Example: Multivalued attributes: phone no. 3.Derived Attributes Can be computed from other attributes E.G. age, given date of birth
  • 8.
    Mapping Constraint ➢ Mappingcardinalities, or cardinality ratio, express the number of entities to which another entity can be associated via a relationship set. ➢ For a binary relationship set the mapping cardinality must be one of the following types: 1.One-to-one 2.One-to-many 3.Many-to-one 4.Many-to-many
  • 9.
    One-to-one ➢ An entityis A, is associated with at most one entity in B, and entity B is associated with at most one entity in A. Example:-
  • 10.
    One-to-many ➢ An entityis 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. Example:-
  • 11.
    Many-to-one ➢ An entityin A is associated with at most one entity in B. An entity in B, however, can be associated with at most one entity in any number(Zero or more) of entities in A. Example:-
  • 12.
    Many-to-many ➢ An entityin A is associated with any number(Zero or more) of entities in B. And an entity in B is associated with at most one entity in any number (Zero or more) of entities in A. Example:-
  • 13.
    Keys  We musthave a way to specify how entities within a given set are distinguished.  Keys are very important part of Relational database model. They are used to establish and identify relationships between tables and also to uniquely identify any record or row of data inside a table.
  • 14.
    Primary key ➢ Primarykey is a candidate key that is most appropriate to become the main key for any table. It is a key that can uniquely identify each record in a table.
  • 15.
    Candidate Key  Candidatekeys are defined as the minimal set of fields which can uniquely identify each record in a table. It is an attribute or a set of attributes that can act as a Primary Key for a table to uniquely identify each record in that table.
  • 16.
  • 17.
    Foreign Key  AForeign ket in one table points to a primary key in another table  A foreign kay can have a different name than the primary key it comes from.  The primary key used by a foreign key is also known as a parent key.  Foreign key value can be null, even though primary key value can’t  Foreign key don’t have to be unique in fact, they often aren’t
  • 18.
    ER Diagram ➢ Anentity relationship diagram (ERD), also known as an entity relationship model, is a graphical representation of an information system that depicts the relationships among people, objects, places, concepts or events within that system.
  • 20.
  • 21.
  • 22.