SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

Error detection recovery
Error detection recoveryError detection recovery
Error detection recovery
Tech_MX
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
saurabhshertukde
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
koolkampus
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMS
koolkampus
 
Object relational and extended relational databases
Object relational and extended relational databasesObject relational and extended relational databases
Object relational and extended relational databases
Suhad Jihad
 

La actualidad más candente (20)

ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
Error detection recovery
Error detection recoveryError detection recovery
Error detection recovery
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Indexing
IndexingIndexing
Indexing
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMS
 
Object relational and extended relational databases
Object relational and extended relational databasesObject relational and extended relational databases
Object relational and extended relational databases
 
Star schema
Star schemaStar schema
Star schema
 
SQL.ppt
SQL.pptSQL.ppt
SQL.ppt
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
 
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick LearningOracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
 
Entity (types, attibute types)
Entity (types, attibute types)Entity (types, attibute types)
Entity (types, attibute types)
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and properties
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbms
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Temporal databases
Temporal databasesTemporal databases
Temporal databases
 

Similar a Er model

Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
Slideshare
 
Basic database analysis(database)
Basic database analysis(database)Basic database analysis(database)
Basic database analysis(database)
welcometofacebook
 

Similar a Er model (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
 
ER Model in the Database Computer Science.pdf
ER Model in the Database Computer Science.pdfER Model in the Database Computer Science.pdf
ER Model in the Database Computer Science.pdf
 
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
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Último (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Er model

  • 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

Notas del editor

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