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
| Construct | Mapping | Reason |
|---|---|---|
| regular entity | โ relation | direct |
| composite attr | โ components | atomicity |
| multivalued attr | โ new relation | atomicity (1NF) |
| weak entity | โ inherited composite PK | identifying 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 / State | Construct | Result |
|---|---|---|
| 0 (Init) | โ | โ |
| 1 | composite address | 4 component attributes |
| 2 | multivalued emp_skills | EMP_SKILL relation |
| 3 | weak DEPENDENT | EMP_DEPENDENT composite PK |
โ ๏ธ Common Mistakes
- ๐ก Bare multivalued split leaves redundancy โ the same skill repeats across employees (Database Anomalies); add a
SKILLlookup relation to store each description once.
๐ง Active Recall
How are composite and multivalued attributes mapped, and why?
- Hint: Atomicity.
Answer
- Short answer: Composite โ simple components; multivalued โ new relation (PK = original PK + attribute).
- Why: 1NF โ relations store atomic values only.
How is a weak entity mapped, and the residual problem with a bare multivalued mapping?
- Hint: Composite PK + redundancy.
Answer
- Short answer: Weak entity โ composite PK (parent PK + own partial key, parent PK also FK); bare multivalued split repeats values.
- Why: Lookup relation โ a
SKILLtable stores each description once, avoiding anomalies.