Associative Entity

Context: FIT2094_MOC · resolves a many-to-many relationship · a bridging entity with a composite key · the only way Crow’s Foot stores relationship attributes

Quick Revision

  • 🎯 Objective: bridge two entities in an M:N ➔ split into two 1:M, carrying the association’s attributes.
  • 📦 Core Components: composite key (both parents’ keys) ➔ two identifying relationships.
  • ⚡ Key Constraint: the only way Crow’s Foot stores relationship attributes.

📝 Core

1. The Bridge

  • Definition ➔ an entity between two entities in an M:N relationship, turning it into two 1:M.
  • Keycomposite of the two parents’ keys.
  • Holds ➔ any attributes belonging to the M:N association.

2. Why It Exists

  • Crow’s Foot limit ➔ can’t attach attributes to a relationship line.
  • Break the M:N ➔ insert a middle entity (ORDER_PRODUCT).
  • Weak entity ➔ joins both parents by two identifying relationships.

3. When to Add

  • Conceptual ➔ keep M:N; add a bridge only when attributes to record.
  • Logicalevery M:N resolved (relational DBs can’t implement M:N).

⚙️ Core Implementation

🔹 ORDER–PRODUCT bridge

⚖️ Core Decision Matrix

StageM:N handlingTrigger
conceptualkept as M:Nsimpler/desirable
conceptual + attrsadd bridgeattributes to store
logical (relational)always resolveno relational M:N
keycomposite PK + 2 FKsboth parents

When It Flips: the bridging entity inherits both parents' keys, so it joins them by two identifying relationships and is itself a weak entity. A bridge table is an n-ary Relation over the parents' keys.

📊 Exam Execution Trace

Manual Execution Trace

STUDENT enrols UNIT (with enrolment attributes):

Step / StateElementResult
0 (Init)
1STUDENT M:N UNITneeds bridge
2attributesenrol_year, mark, grade
3bridgeENROLMENT (composite key)

Applied Exercise

Problem: Resolve STUDENT M:N UNIT carrying enrol_mark, enrol_grade. Derivation Proof / Hand-Calculation Walkthrough:

Final Extracted Output: two 1:M (STUDENT makes ENROLMENT, UNIT has ENROLMENT); composite key holds the attributes.

🧠 Active Recall