1. Relationships
Relationship: The association among entities is called a relationship.
2. Relationship Type
Relationship type: Defines a relationship set among entities of certain entity types. We assign a name to a relationship type (usually) using a verb.
An entity type can have more than one relationship with another entity type. Relationship types may be given role names to indicate purpose that each participating entity type plays in a relationship.


3. Degree of a Relationship
Degree of a Relationship: The degree of a relationship is the number of entity types participating in the relationship.
When we speak of a student registered for a course, we are discussing a relationship, register, where two entity types (Student and Course) are involved; the relationship is of degree 2 because each instance of register will always involve one student entity type and one course entity type.
Relationships of degree 2 are called binary relationships; relationships of degree 3 are called ternary relationships[三元关系]. In general, we speak of n-ary relationships where n entities participate in a relationship.

3.1 Recursive Relationship
A Recursive Relationship[递归关系] is one in which a relationship exists between occurrences of the same entity type. These are also called unary relationships[一元关系].
A typical business example arises when we have a business rule such as "a staff member supervises other staff members". • The role of one staff member may be supervisor[管理者] whereas the role of another staff member may be supervisee.

4. Structural Constraints
4.1 Cardinality
Cardinality: Cardinality[基数] is a constraint[限制] on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship.
There are three classifications, and these are:
• one-to-one (1:1)
• one-to-many (1:*)
• many-to-many (*:*)
4.1.1 one-to-one (1:1) Cardinality
One-to-one relationships have 1 specified for both cardinalities, and do not seem to arise very often. To illustrate a one-to-one, we require very specific business rules.
Suppose we have Staff and Vehicles. Assume that we are only concerned with the current driver of a vehicle, and that we are only concerned with the current vehicle that a driver is operating. Then, we have a one-to-one relationship between Staff and Vehicle.
4.1.2 one-to-many (1:*) Cardinality
For example, A Branch entity has many Staff members; and each Staff entity works in one Branch
4.1.3 many-to-many (*:*) Cardinality
For example, An Actor entity stars in many Videos; and a Video entity has many Actors.
4.2 Participation
Participation: Determines whether all or only some entity occurrences participate in a relationship.
There are 2 classifications for participation, these are optional and mandatory[强制].
• Optional means that each entity may or may not participate in the relationship.
• Mandatory means that each entity must participate in the relationship
To represent (record) the cardinality and participation constraints, we will use 2 numbers (min, max) where min represents the minimum participation of an entity in the relationship (participation). Max represents the maximum participation of an entity in the relationship (cardinality).
• The min value can be 0 (for optional) or 1 (for mandatory).
• The max value can be 1 (for 1) or * (for many).
• Note that these values may vary if a specific min and/or max value is given
4.3 Summary

5. Relationship Type Attributes
Attributes[属性] can also be assigned to relationship types. They represent a data item value that needs to be recorded when an entity occurrence on each side of the relationship is associated with one another.
• For Example, suppose we have entity types Student and Module that are associated via a studies relationship type. An attribute that helps to describe a Student studying a Module is grade. This will record the grade that each student obtains on each module that they are associated with.
本文详细解释了实体间的关系概念,包括关系类型、度量、递归关系、结构性约束(如基数和参与性)、以及关系类型属性。通过实例阐述了一对一、一对多和多对多关系的典型应用。
3

被折叠的 条评论
为什么被折叠?



