Mapping Entities and Attributes (Logical)

Context: FIT2094_MOC ยท entity โ†’ relation ยท composite โ†’ component attributes ยท multivalued & weak entity โ†’ new relation ยท part of Logical Modelling (ER Mapping)

Quick Revision

  • ๐ŸŽฏ Objective: map entities/attributes to relations storing only atomic values โž” regular entity โ†’ relation.
  • ๐Ÿ“ฆ Core Components: composite โ†’ components โž” multivalued โ†’ new relation โž” weak entity โ†’ inherited composite PK.
  • โšก Key Constraint: atomicity (1NF) drives every rule; bare multivalued split leaves redundancy.

๐Ÿ“ Core

1. Regular Entity

  • Entity โ†’ relation โž” name โ†’ relation, key โ†’ Primary Key, attributes โ†’ attributes.

2. Composite Attribute

  • List components โž” only the simple parts (customer_address โ†’ cust_street, cust_city, cust_state, cust_zip).
  • Ask the client โž” if unsure whether to decompose (e.g. phone); * marks not-null.

3. Multivalued & Weak Entity

  • Multivalued โ†’ new relation โž” PK = original PK + the multivalued attribute (FK back).
  • Weak entity โ†’ composite PK โž” parent PK + own partial key (parent PK also FK).
  • Lookup relation โž” reduces redundancy (EMPLOYEE โ€” EMP_SKILL โ€” SKILL).

Key identities:

โš–๏ธ Core Decision Matrix

ConstructMappingReason
regular entityโ†’ relationdirect
composite attrโ†’ componentsatomicity
multivalued attrโ†’ new relationatomicity (1NF)
weak entityโ†’ inherited composite PKidentifying relationship

When It Flips: atomicity is the driver โ€” composite and multivalued attributes both violate the relational atomic-value rule (First Normal Form (1NF)). A weak entity's inherited parent PK lands inside the child's composite PK (solid-line identifying relationship).

๐Ÿ“Š Exam Execution Trace

Manual Execution Trace

Mapping attribute types:

Step / StateConstructResult
0 (Init)โ€”โ€”
1composite address4 component attributes
2multivalued emp_skillsEMP_SKILL relation
3weak DEPENDENTEMP_DEPENDENT composite PK

โš ๏ธ Common Mistakes

  • ๐Ÿ’ก Bare multivalued split leaves redundancy โž” the same skill repeats across employees (Database Anomalies); add a SKILL lookup relation to store each description once.

๐Ÿง  Active Recall