Entity Relationship Model
Entity Relationship Model
Types of attributes:
Simple (atomic) – attributes that are not divisible.
o Example – mobile_no
Dr. P. Gayathri, Professor, SCOPE Page 1
Composite – can be divided into smaller sub parts.
o Example – address – street_address, city, state, zip
o Forms hierarchy.
Example – street_address – number, street,
apartment_number
o Value of composite attribute is the concatenation of values of
its constituent simple attributes
Complex attribute:
Nesting of composite and multi-valued attributes.
Composite – have simple components – represented between
parenthesis and separating the components with commas
Multivalued attribute – represented between { }
Example:
o Assume that each person can have more than one residence
and each residence have single address and multiple phones.
o Let the attribute name be Address_phone
Note:
Sometimes, several attributes together form a key – combinations
of attribute values are distinct for each entity
Options:
Can be represented in Employee entity using multivalued attribute
called works_on with project and hours as simple attributes
We choose first option. Refer below figure for final initial schema of
Employee entity.
Example – M:N
Participation constraints:
Specifies whether existence of an entity in the entity set depends
on its relationship to another entity via the relationship type
Sometimes, called as minimum cardinality constraint
2 types – Total (existence dependency) and Partial
Example – Total:
Every entity in the Employee entity set is related to Department via
works_for relationship type
Participation of employee in works_for relationship is total
In ER diagram, total participation is represented as double line
between entity type and relationship
Structural constraints:
Cardinality ratio and participation constraint taken together is
called as structural constraints of relationship type.