Relationship Types, Relationship Sets, Roles, and Structural Constraints
There are several implicit relationships among the various entity types. In fact, whenever an attribute of one entity type refers to another entity type, some relationship exists.
- the attribute Manager of DEPARTMENT refers to an employee who manages the department;
- the attribute Controlling_department of PROJECT refers to the department that controls the project;
- the attribute Supervisor of EMPLOYEE refers to another employee (the one who supervises this employee);
- the attribute Department of EMPLOYEE refers to the department for which the employee works; and so on.
In the ER model, these references should not be represented as attributes but as relationships, which are discussed in this section. The COMPANY database schema will be refined to represent relationships explicitly. In the initial design of entity types, relationships are typically captured in the form of attributes. As the design is refined, these attributes get converted into relationships between entity types.
Relationship Types, Sets, and Instances
A relationship type R among n entity types E1, E2, ..., En defines a set of associations—or a relationship set—among entities from these entity types. As for the case of entity types and entity sets, a relationship type and its corresponding relationship set are customarily referred to by the same name, R.
Mathematically, the relationship set R is a set of relationship instances ri , where each ri associates n individual entities (e1, e2, ..., en), and each entity ej in ri is a member of entity set Ej , 1 ? j ? n. Hence, a relationship set is a mathematical relation on E1, E2, ..., En; alternatively, it can be defined as a subset of the Cartesian product of the entity sets E1 × E2 × ... × En.
|Topics You May Be Interested In|
|Subclasses, Superclasses, And Inheritance||Relational Query Languages|
|Specialization And Generalization||Overview Of The Sql Query Language|
|Using High-level Conceptual Data Models For Database Design|