中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

2.2 Database Systems: Relationships & Relationship Sets

  • A relationship is an association between several entities.
     A relationship set is a set of relationships of the same type.
     Formally it is a mathematical relation on n  2 (possibly non-distinct) sets.
    If E1;E2....En are entity sets, then a relationship set R is a subset of
    if{(e1,e2. . . .. en) |e1∈ E1; e2 ∈ E2; . . . ∈ En}
    where (e1; e2; . . .; en) is a relationship.
    For example, consider the two entity sets customer and account. (Fig. 2.1 in the text). We de ne the relationship CustAcct to denote the association between customers and their accounts. This is a binary relationship set (see Figure 2.2 in the text).
    Going back to our formal de nition, the relationship set CustAcct is a subset of all the possible customer and account pairings.
    This is a binary relationship. Occasionally there are relationships involving more than two entity sets.
    The role of an entity is the function it plays in a relationship. For example, the relationship works-for could be ordered pairs of employee entities. The rst employee takes the role of manager, and the second one will take the role of worker.
    A relationship may also have descriptive attributes. For example, date (last date of account access) could be an attribute of the CustAcct relationship set.

Database System Structure: