SlideShare a Scribd company logo
1 of 35
ER MODEL
ER Model
• The entity-relationship model (or ER model) is a high-level conceptual
data model representing the logical relationships of entities (or
objects) in order to create a database and is widely used to develop
an initial database design.
• ER model was first proposed by Peter Pin-Shan Chen of
Massachusetts Institute of Technology (MIT) in the 1970s.
• The diagrammatic notation used in the ER model for representing
entities with properties and their relationships is known as ER
diagrams.
2
Entity and Entity Sets
• Entities
• An entity is a “thing” or “object” in the real world that is
distinguishable from all other objects.
For example, each person in an enterprise is an entity.
• Entity Sets
• An entity set is a set of entities of the same type that share the
same properties, or attributes.
• Set of all persons who are customers at a given bank can
be defined as the entity set customer.
• Other examples: students, courses, employees, departments,
flights, patients.
3
Entity and Entity Sets
Entity Sets Customer and Loan
4
Attributes
• Attributes are descriptive properties possessed by each
member of an entity set.
• Possible attributes of the customer entity set are customer-id,
customer-name, customer-street, and customer-city.
• Other examples: course name, deptname, departure time, age,
room
• For each attribute, there is a set of permitted values, called the
domain, or value set, of that attribute.
5
Attributes
• Single-valued vs Multi-valued:
• Single valued attributes have a single value for a particular entity
while Multi-valued attributes have a set of values for a specific entity.
• Eg. color of car could be multi-valued
• salary of employee is single-valued
• Atomic vs Composite:
• Atomic attributes are not divided into subparts while Composite
attributes can be divided into subparts (other attributes).
• Eg. age of a person is atomic
• address of a person could be composite
• Stored vs Derived:
• Derived attributes are those that can be derived from other attributes
or entities, e.g., age can be derived from date of birth.
• All other attributes are stored attributes
6
Composite attributes
7
Relationships
• Relationship:
• An association between multiple entities
• Relationship Set:
• A collection of relationships all belonging to one relationship
type.
• A relationship may also have attributes called descriptive
attributes.
• It may be Unary, Binary, Ternary, 4-nary relationship sets
8
Relationship
Relationship set borrower
9
Weak Entity Sets
• Entity sets that do not have sufficient attributes to form a key
are called weak entity sets.
• For a weak entity set to be meaningful, it must be associated
with another entity set, called the identifying or owner entity
set.
• So, a weak entity set existentially depend upon (one or more)
strong owner entity sets from whom they derive their key.
• A weak entity set may have a discriminator (or a partial key)
that distinguish between weak entities related to the same
strong entity
• key of weak entity set = Key of owner entity set(s) +
discriminator
10
Weak Entity Sets(Contd.)
Example:
Consider the entity set payment, which has the three attributes:
payment-number, payment-date, and payment-amount.
• Payment numbers are typically sequential numbers, starting
from 1, generated separately for each loan.
• Although each payment entity is distinct, payments for different
loans may share the same payment number.
• Thus, this entity set does not have a primary key; it is a weak
entity set.
11
ER Diagram
12
Example: Weak Entity Set Notations
• Double rectangles for weak entity set
• Double diamond for weak entity relationship
• Dashed underscore for discriminator
13
Structural Constraints
• Two main types of restrictions on relationships are:
• Cardinality Constraints
• Participation Constraints
• Cardinality Constraints is the number of instances of one
entity that can or must be associated with each instance
of another entity
14
Cardinality Constraints on Relationship
Sets
• Consider binary relationship set R
between entity sets A and B
• 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.
• an employee has only one spouse in a married-
to relationship.
15
Cardinality Constraints on Relationship
Sets(Contd.)
• 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.
• A customer can order different items online.
16
Cardinality Constraints on Relationship
Sets(Contd.)
• Many to One: An entity in A is
associated with at most one entity in B,
an entity in B is associated with many
entities in A.
• an employee works in a single department
but a department consists of many
employees.
17
Cardinality Constraints on Relationship
Sets(Contd.)
• Many to Many: An entity in A is associated
with many entities in B, and an entity in B
is associated with many entities in A.
• A customer may have many bank accounts.
Accounts may be joint between multiple
customers.
18
19
Alternative Cardinality Specification
Both many and 1 include 0.
Meaning some entity may not participate in the relationship
20
Alternative Cardinality Specification
21
Participation Constraints
• Total Participation:
• The participation of an entity set in a relationship set is said to be
total if every entity from the entity set participates in at least one
relationship of the relationship set.
• Partial Participation:
• If only some entities from entity sets participates in relationships of
relationship set, then the participation is called partial.
22
Total participation
• When we require all entities to participate in the
relationship (total participation), we use double lines to
specify
• A double line from loan to borrower indicates that each
loan must have at least one associated customer.
23
Keys
• A key allows to identify a set of attributes that suffice to
distinguish entities from each other.
• A super key of an entity set is a set of one or more attributes that,
taken collectively, allow to identify uniquely an entity in the entity
set.
• A candidate key of an entity set is a minimal super key.
i.e. it uniquely identifies any database record without referring to any other
data.
• Although several candidate keys may exist, one of the candidate
keys is selected to be the primary key.
24
Key Examples
• Suggest super keys for the following entity?
• What are the candidate keys?
• Primary key?
25
Degree of Relationship
• Degree of a relationship is the number of entity types that
participate in it
One entity
related to
another of
the same
entity type
Entities of two
different
types related
to each other
Entities of three
different types
related to each
other
26
Unary relationship(Role indicator)
• The labels “manger” and “worker” are called roles the self relationship
• More Examples?
• People to people
• Parent – children
• Manager – employee
• Husband – wife
• Word to word
• Root – synonym
27
Role indicator
• The function that an entity plays in a relationship is called
its role
• Roles are normally not explicitly specified unless the
meaning of the relationship needs clarification
• Roles needed when entity set is related to itself via a
relationship.
28
Ternary Relationship
29
Example
30
Extended ER Features
• Generalization and Specialization
• Aggregation
31
Generalization and Specialization
• A lower-level entity set inherits all the attributes and
relationship participation of the higher-level entity set to which it
is linked.
• A lower-level entity set may have additional attributes and
participate in additional relationships.
• Generalization is a bottom-up approach in which two or more
lower level entities combine to form a higher level entity.
• In generalization, the higher level entity can also combine with
other lower level entity to make further higher level entity.
• Specialization is a top-down approach in which one higher
level entity can be broken down into two or more lower level
entity.
32
Generalization and Specialization
33
Aggregation
• One limitation of the E-R model is that it cannot express relationships among
relationships.
• consider the ternary relationship “works-on” between a employee, branch,
and job.
• suppose we want to record managers for tasks performed by an employee at
a branch.
• One alternative for representing this
relationship is to create a quaternary
relationship manages between
employee, branch, job, and manager.
• There is redundant information in the
resultant figure.
34
Aggregation
• Aggregation is an abstraction through which relationships are
treated as higher level entities.
• Aggregation is a process when relation between two entity is
treated as a single entity.
35

More Related Content

What's hot

2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMSkoolkampus
 
Interaction Modeling
Interaction ModelingInteraction Modeling
Interaction ModelingHemant Sharma
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and modelssabah N
 
Mapping cardinalities
Mapping cardinalitiesMapping cardinalities
Mapping cardinalitiesArafat Hossan
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersOXUS 20
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMSkoolkampus
 
Object Oriented Relationships
Object Oriented RelationshipsObject Oriented Relationships
Object Oriented RelationshipsTaher Barodawala
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship setMegha Sharma
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancyVisakh V
 

What's hot (20)

Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Normalization
NormalizationNormalization
Normalization
 
Lossless decomposition
Lossless decompositionLossless decomposition
Lossless decomposition
 
ER diagram powerpoint
ER diagram powerpointER diagram powerpoint
ER diagram powerpoint
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
Association agggregation and composition
Association agggregation and compositionAssociation agggregation and composition
Association agggregation and composition
 
Interaction Modeling
Interaction ModelingInteraction Modeling
Interaction Modeling
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and models
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Mapping cardinalities
Mapping cardinalitiesMapping cardinalities
Mapping cardinalities
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and Answers
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMS
 
Object Oriented Relationships
Object Oriented RelationshipsObject Oriented Relationships
Object Oriented Relationships
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship set
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
 
Object oriented databases
Object oriented databasesObject oriented databases
Object oriented databases
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
Entities and attributes
Entities and attributesEntities and attributes
Entities and attributes
 

Similar to ER MODEL DIAGRAM

Similar to ER MODEL DIAGRAM (20)

ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
Entityrelationshipmodel
EntityrelationshipmodelEntityrelationshipmodel
Entityrelationshipmodel
 
Dbms Model.pdf
Dbms Model.pdfDbms Model.pdf
Dbms Model.pdf
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
 
Day 1 SQL.pptx
Day 1 SQL.pptxDay 1 SQL.pptx
Day 1 SQL.pptx
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
Entity-Relationship Data Model
Entity-Relationship Data ModelEntity-Relationship Data Model
Entity-Relationship Data Model
 
Database design
Database designDatabase design
Database design
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
database.pptx
database.pptxdatabase.pptx
database.pptx
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
ICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdf
 
Er model
Er modelEr model
Er model
 
Basic database analysis(database)
Basic database analysis(database)Basic database analysis(database)
Basic database analysis(database)
 
lecture2.pdf
lecture2.pdflecture2.pdf
lecture2.pdf
 
ER MODEL
ER MODELER MODEL
ER MODEL
 

Recently uploaded

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 

Recently uploaded (20)

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 

ER MODEL DIAGRAM

  • 2. ER Model • The entity-relationship model (or ER model) is a high-level conceptual data model representing the logical relationships of entities (or objects) in order to create a database and is widely used to develop an initial database design. • ER model was first proposed by Peter Pin-Shan Chen of Massachusetts Institute of Technology (MIT) in the 1970s. • The diagrammatic notation used in the ER model for representing entities with properties and their relationships is known as ER diagrams. 2
  • 3. Entity and Entity Sets • Entities • An entity is a “thing” or “object” in the real world that is distinguishable from all other objects. For example, each person in an enterprise is an entity. • Entity Sets • An entity set is a set of entities of the same type that share the same properties, or attributes. • Set of all persons who are customers at a given bank can be defined as the entity set customer. • Other examples: students, courses, employees, departments, flights, patients. 3
  • 4. Entity and Entity Sets Entity Sets Customer and Loan 4
  • 5. Attributes • Attributes are descriptive properties possessed by each member of an entity set. • Possible attributes of the customer entity set are customer-id, customer-name, customer-street, and customer-city. • Other examples: course name, deptname, departure time, age, room • For each attribute, there is a set of permitted values, called the domain, or value set, of that attribute. 5
  • 6. Attributes • Single-valued vs Multi-valued: • Single valued attributes have a single value for a particular entity while Multi-valued attributes have a set of values for a specific entity. • Eg. color of car could be multi-valued • salary of employee is single-valued • Atomic vs Composite: • Atomic attributes are not divided into subparts while Composite attributes can be divided into subparts (other attributes). • Eg. age of a person is atomic • address of a person could be composite • Stored vs Derived: • Derived attributes are those that can be derived from other attributes or entities, e.g., age can be derived from date of birth. • All other attributes are stored attributes 6
  • 8. Relationships • Relationship: • An association between multiple entities • Relationship Set: • A collection of relationships all belonging to one relationship type. • A relationship may also have attributes called descriptive attributes. • It may be Unary, Binary, Ternary, 4-nary relationship sets 8
  • 10. Weak Entity Sets • Entity sets that do not have sufficient attributes to form a key are called weak entity sets. • For a weak entity set to be meaningful, it must be associated with another entity set, called the identifying or owner entity set. • So, a weak entity set existentially depend upon (one or more) strong owner entity sets from whom they derive their key. • A weak entity set may have a discriminator (or a partial key) that distinguish between weak entities related to the same strong entity • key of weak entity set = Key of owner entity set(s) + discriminator 10
  • 11. Weak Entity Sets(Contd.) Example: Consider the entity set payment, which has the three attributes: payment-number, payment-date, and payment-amount. • Payment numbers are typically sequential numbers, starting from 1, generated separately for each loan. • Although each payment entity is distinct, payments for different loans may share the same payment number. • Thus, this entity set does not have a primary key; it is a weak entity set. 11
  • 13. Example: Weak Entity Set Notations • Double rectangles for weak entity set • Double diamond for weak entity relationship • Dashed underscore for discriminator 13
  • 14. Structural Constraints • Two main types of restrictions on relationships are: • Cardinality Constraints • Participation Constraints • Cardinality Constraints is the number of instances of one entity that can or must be associated with each instance of another entity 14
  • 15. Cardinality Constraints on Relationship Sets • Consider binary relationship set R between entity sets A and B • 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. • an employee has only one spouse in a married- to relationship. 15
  • 16. Cardinality Constraints on Relationship Sets(Contd.) • 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. • A customer can order different items online. 16
  • 17. Cardinality Constraints on Relationship Sets(Contd.) • Many to One: An entity in A is associated with at most one entity in B, an entity in B is associated with many entities in A. • an employee works in a single department but a department consists of many employees. 17
  • 18. Cardinality Constraints on Relationship Sets(Contd.) • Many to Many: An entity in A is associated with many entities in B, and an entity in B is associated with many entities in A. • A customer may have many bank accounts. Accounts may be joint between multiple customers. 18
  • 19. 19
  • 20. Alternative Cardinality Specification Both many and 1 include 0. Meaning some entity may not participate in the relationship 20
  • 22. Participation Constraints • Total Participation: • The participation of an entity set in a relationship set is said to be total if every entity from the entity set participates in at least one relationship of the relationship set. • Partial Participation: • If only some entities from entity sets participates in relationships of relationship set, then the participation is called partial. 22
  • 23. Total participation • When we require all entities to participate in the relationship (total participation), we use double lines to specify • A double line from loan to borrower indicates that each loan must have at least one associated customer. 23
  • 24. Keys • A key allows to identify a set of attributes that suffice to distinguish entities from each other. • A super key of an entity set is a set of one or more attributes that, taken collectively, allow to identify uniquely an entity in the entity set. • A candidate key of an entity set is a minimal super key. i.e. it uniquely identifies any database record without referring to any other data. • Although several candidate keys may exist, one of the candidate keys is selected to be the primary key. 24
  • 25. Key Examples • Suggest super keys for the following entity? • What are the candidate keys? • Primary key? 25
  • 26. Degree of Relationship • Degree of a relationship is the number of entity types that participate in it One entity related to another of the same entity type Entities of two different types related to each other Entities of three different types related to each other 26
  • 27. Unary relationship(Role indicator) • The labels “manger” and “worker” are called roles the self relationship • More Examples? • People to people • Parent – children • Manager – employee • Husband – wife • Word to word • Root – synonym 27
  • 28. Role indicator • The function that an entity plays in a relationship is called its role • Roles are normally not explicitly specified unless the meaning of the relationship needs clarification • Roles needed when entity set is related to itself via a relationship. 28
  • 31. Extended ER Features • Generalization and Specialization • Aggregation 31
  • 32. Generalization and Specialization • A lower-level entity set inherits all the attributes and relationship participation of the higher-level entity set to which it is linked. • A lower-level entity set may have additional attributes and participate in additional relationships. • Generalization is a bottom-up approach in which two or more lower level entities combine to form a higher level entity. • In generalization, the higher level entity can also combine with other lower level entity to make further higher level entity. • Specialization is a top-down approach in which one higher level entity can be broken down into two or more lower level entity. 32
  • 34. Aggregation • One limitation of the E-R model is that it cannot express relationships among relationships. • consider the ternary relationship “works-on” between a employee, branch, and job. • suppose we want to record managers for tasks performed by an employee at a branch. • One alternative for representing this relationship is to create a quaternary relationship manages between employee, branch, job, and manager. • There is redundant information in the resultant figure. 34
  • 35. Aggregation • Aggregation is an abstraction through which relationships are treated as higher level entities. • Aggregation is a process when relation between two entity is treated as a single entity. 35

Editor's Notes

  1. Example: Employee assigned to project. Student gets scholarship. Students apply for scholarship.
  2. A person is married to a person, employee supervises employee.