
Session 2: E-R Data Model (CH-2)
CSCI-585, Cyrus Shahabi
• Data Model: A collection of conceptual tools for describing data, data
relationships, data semantics & consistency constraints. Example: Entity
Relationships Data Model (E-R model)
• Based on a perception of a real world which consists of a set of basic
objects called entities and relationships among these objects.
• Entity: An entity is an object that exists and is distinguishable from other
objects (e.g., Tony with SS#, csci585 in Spring-2001, …)
• Entity set: A set of entities of the same type (e.g., students, courses).
Presented as:
• Entity sets need not to be disjoint (e.g., Pamu (TA) is both a student and
an employee of USC)
• Attributes: An entity is represented by a set of attributes (e.g., student:
name, SS#, age, address, …). Attribute can be considered as a function
that maps an entity into a domain (e.g., SS#: entity->integer).
Presented as:
• Relationship: A relationship is an association among several entities
(e.g., enrolled relationship associates Tony with cscsi-585)
• Relationship set: A set of relationships with the same type. Formal
definition:
Presented as:
• Role: The function that an entity plays in a relationship is called its role.
Normally implicit.
• Recursive relationship: Same entity set participates more than once in a
relationship in different roles. Role names, hence, become essential:
Student
Manage
Employee
Enrolled