using an associative entity Create another entity to represent the combination

Using an associative entity create another entity to

This preview shows page 51 - 63 out of 90 pages.

using an associative entity Create another entity to represent the combination of the participating entities: STUDENT OFFERING ENROLMENT STUDENT OFFERING This is known as an associative entity (also called an association or intersection entity) The identifier of the associative entity is the combination of the identifiers from the related entities
M:N Relationships with attributes StdSSN StdName Student OfferNo OffLocation OffTime Offering EnrGrade In a M:N relationship there may be attributes associated with the combination of both entities - e.g. a grade is associated with a student enrolled in an offering of a unit The diagram is not normally left like this, though
Improved precision StdSSN StdName Student OfferNo OffLocation OffTime Offering EnrGrade Enrollment AttDate Present Attendance Replacing the M:N with two relationships and an associative entity can improve precision of the model: The association may have attributes (e.g. Grade for the Student:Offering relationship) The association may need to be related to other entities
Example… AuthNo AuthName Author ISBN Title Book AuthOrder b) Writes relationship Writes How would this be drawn using an associative (intersection) entity?
Other types of relationships Other types of relationships you may meet include: More than one relationship between the same entities Recursive relationships Multi-way relationships
More than one relationship between the same entities This may be necessary to represent the complete meaning of the system: - PERSON works on PROJECT PERSON leads PROJECT - STUDENT borrows LIBRARY BOOK - STUDENT recalls LIBRARY BOOK Model with separate relationships, as they may have different maximum and minimum cardinalities PERSON PROJECT leads works on
Recursive Relationships A recursive relationship occurs when an entity has a relationship with itself Also known as unary or self-referencing relationships Examples: A member of faculty may supervise other members of faculty and, in turn be supervised by other members of faculty A unit may be a prerequisite for other units
Example of a recursive relationship Faculty1 Faculty2 Faculty3 Faculty4 Faculty5 IS300 IS320 IS480 IS460 IS461 (a) Supervises (b) PreReqTo (drawn schematically, not an ERD):
Drawing recursive relationships FacSSN FacName Faculty a) manager-subordinate b) unit prerequisites UnitNo UnitTitle Unit The ERD shows a relationship line drawn from one side of the entity to the other, using the usual cardinality and optionality symbols
Multi Way (M-Way) Relationships Relationship between more than two entities Binary two entities (the usual) Ternary three entities Quarternary four entities N-ary many entities Generally represented as a series of binary relationships with an associative entity to represent the relationship
M-Way Relationships PartNo PartName Part SuppNo SuppName Supplier Associative entity type ProjNo ProjName Project Uses
Entity-Relationship Modelling Weak entities

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture