During logical-to-physical mapping, the unique identifier of an entity in an ER model becomes which key in the relational table that represents that entity?
-
Aforeign key
-
Bmain attribute
-
Cprimary key
-
Didentity key
-
Ealternate key
Answer
Correct Answer: primary key
Explanation
Introduction / Context:Entity-Relationship (ER) modeling captures real-world entities and their identifiers. When converting an ER model into relational tables, each entity becomes a table and its identifier becomes the table's primary key, ensuring row-level uniqueness and stable referencing from related tables.
Given Data / Assumptions:
- An ER diagram defines entities with identifiers (natural or surrogate).
- We are mapping to a relational schema.
- We need stable, unique row identification and referential targets for relationships.
Concept / Approach:The primary key uniquely identifies each row in the relational table that represents the entity. Relationships are implemented using foreign keys that reference these primary keys. Alternate keys can exist but are not the chosen primary key; identities/serials are one way to implement a surrogate primary key.
Step-by-Step Solution:
Identify the entity's identifier in the ER model.Implement that identifier as the table's PRIMARY KEY (possibly composite).Define foreign keys in related tables to reference this primary key.Verification / Alternative check:Confirm that the primary key prevents duplicates and provides a target for referential constraints from child tables.
Why Other Options Are Wrong:
- Foreign key: Lives in a different (child) table and points to the primary key.
- Main attribute: Not a standard SQL term; ambiguous.
- Identity key: A mechanism for generating PK values, but not the conceptual mapping itself.
- Alternate key: A candidate key not chosen as the primary key.
Common Pitfalls:Choosing a non-stable attribute (like mutable names) as the primary key can cause cascading updates. Prefer stable natural keys or surrogate keys as appropriate.
Final Answer:primary key