We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 29
ER Modeling
E-R Model Constructs
• Entity instance - person, place, object, event, concept (often corresponds to a row in a table) • Entity Type – collection of entities (often corresponds to a table) • Attribute - property or characteristic of an entity type (often corresponds to a field in a table) • Relationship instance – link between entities (corresponds to primary key-foreign key equivalencies in related tables) • Relationship type – category of relationship…link between entity types Composite attribute What Should an Entity Be? • SHOULD BE: • – An object that will have many instances in • the database • – An object that will be composed of multiple • attributes • – An object that we are trying to model • • SHOULD NOT BE: • – A user of the database system • – An output of the database system (e.g. a • report) Attributes • Attribute - property or characteristic of an • entity type • • Classifications of attributes: • – Required versus Optional Attributes • – Simple versus Composite Attribute • – Single-Valued versus Multivalued Attribute • – Stored versus Derived Attributes • – Identifier Attributes Identifiers (Keys) • Identifier (Key) - An attribute (or • combination of attributes) that uniquely • identifies individual instances of an entity • type • • Simple Key versus Composite Key • • Candidate Key – an attribute that could be • a key…satisfies the requirements for being • a key Characteristics of Identifiers • Will not change in value • • Will not be null • • No intelligent identifiers (e.g. containing • locations or people that might change) • • Substitute new, simple keys for long, • composite keys Composite Attribute Composite key attribute Simple key attribute Entity with a multivalued attribute (Skill) and derived attribute (Years_Employed) An attribute that is both multivalued and composite Degree of Relationships • Degree of a relationship is the number of entity types that • participate in it – Unary Relationship – Binary Relationship – Ternary Relationship Cardinality of Relationships • One-to-One – Each entity in the relationship will have exactly one related entity • One-to-Many – An entity on one side of the relationship can have many related entities, but an entity on the other side will have a maximum of one related entity • Many-to-Many – Entities on both sides of the relationship can have many related entities on the other side Basic relationship with only maximum cardinalities showing Mandatory minimum cardinalities Optional cardinalities with unary degree, one-to-one relationship A binary relationship with an attribute
Here, the date completed attribute pertains specifically to the
employee’s completion of a course…it is an attribute of the relationship Entities can be related to one another in more than one way