Entities, Relationships, and Attributes

An EER database contains data about entities and their relationships. Entities and relationships are qualified by attributes representing their descriptive properties. Similar entities, that is entities of the same type, are classified in entity-sets. For instance, PERSON denotes the entities of an entity-set with attributes NAME and AGE, while ASSIGNED denotes the relationships between the entities of entity-sets PERSON and PROJECT.

Attributes take their values from underlying primitive domains called value-sets. Value-sets can be restricted to specific (controlled) values or ranges of values; such value-sets are called controlled value-sets. For example, the value-set of attribute AGE can be specified as consisting of integers between 13 and 65, while the value-set of attribute SEX can be specified as consisting of only two values, ``Male'' and ``Female''.

A subset of the attributes associated with an entity-set is specified as its entity-identifier. Entity-identifiers are used to distinguish among the instances of an entity-set. An entity-set must have a primary entity-identifier and can have several alternative entity-identifiers. For example, SSN can be a primary identifier for entity-set PERSON, while NAME can be an alternate identifier for PERSON.

Entity-identifiers are not always enough to uniquely distinguish among the instances of an entity-set. For example, a reference may appear in several publications and therefore the entity-identifier NAME of entity-set REFERENCE is not enough to uniquely distinguish between the various instances of references with the same name that have appeared in different publications. Such entity-sets are called weak, and said to depend for identification (ID-dependent) on other entity-sets. Then the instances of a weak entity-set, E are uniquely identified using the primary identifier of E together with the primary identifiers of the entity-sets on which E is ID-dependent.

An entity-set that is involved in a relationship-set is said to have a role in that relationship-set. Roles are essential in distinguishing the multiple involvements of an entity-set in a relationship-set.

In the EER model attributes are by default single-valued and primitive, that is, they can be associated only with primitive value-sets and cannot take values from entity-sets, that is, cannot be defined as abstract. These restrictions can be overcome in the following way:

  1. In order to specify a primitive multi-valued attribute, such as PHONE-NR of entity-set PERSON, a unary relationship PERSON and associated with attribute PHONE-NR can be specified.
  2. In order to specify a single-valued abstract attribute, such as attribute EDITOR of entity-set PUBLICATION, that takes values from another entity-set, such as entity-set PERSON, PUBLICATION can be specified as having EDITOR; this association is called a HAS association and is denoted as follows: PUBLICATION HAS EDITOR. If the attribute is not allowed to have null values then this association is called an ALWAYS_HAS association (e.g., PUBLICATION ALWAYS_HAS EDITOR).

Association-cardinality is a restriction placed on an entity-set with respect to a relationship-set. Association-cardinalities can be either one or many. For example, suppose that a relationship-set ASSIGNED associates entity-sets PERSON and PROJECT. If every person can be assigned to several projects then PROJECT has an association-cardinality of many, otherwise (i.e., if a person can be assigned to at most one project) PROJECT has an association-cardinality of one.

The involvement of objects in relationships is by default optional. For example, the instances of entity-set PROJECT may or may not be involved in relationship-set ASSIGNED, which means that there could be projects that are not assigned to any department. Conversely, the involvement of an object-set in a relationship-set can be specified as mandatory, which means that an object of that object-set must be involved, at any time, in at least one relationship of the respective relationship-set.

Generalization allows viewing a set of entity-sets (e.g., authors, students, scientists) as a single generic entity-set (e.g., persons). The attributes which are common to the entity-sets that are generalized (such as name and age) are then represented only once, associated with the generic entity-set. Similarly, relationship-sets that are common to the entity-sets that are generalized are associated with the generic entity-set. The entity-sets that are generalized can have additional attributes of their own (e.g., scientists can have degrees) and can be involved in relationship-sets in which the generic entity-set is not involved. The inverse of generalization is called specialization. A specialization entity-set inherits all the attributes of any of its generic entity-sets, including the entity-identifier.