SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Elmasri Navathe
Chapter:
Relational Database Design By Er- And Eer-to-relational Mapping
Exercise:
Review Questions
Question:1 | ISBN:9780133970777 | Edition: 7

Question

(a) Discuss the correspondences between the ER model constructs and the relational model constructs. Show how each ER model construct can be  mapped to the relational model and discuss any alternative mappings.
(b) Discuss the options for mapping EER model constructs to relations, and  the conditions under which each option could be used.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

a)

Correspondences between ER Model and Relational Model Constructs:

  1. Entity Sets:

    • Correspondence: An entity set in the ER model maps to a relation (table) in the relational model.
    • Mapping: Each entity set becomes a table in the relational model, with each entity becoming a row, and attributes becoming columns.
  2. Relationships:

    • Correspondence: Relationships in the ER model can be represented using foreign keys in the relational model.
    • Mapping: Relationships become associations between tables, and foreign keys are used to establish the connections between related entities.
  3. Attributes:

    • Correspondence: Attributes in the ER model map to columns in the relational model.
    • Mapping: Each attribute becomes a column in the corresponding relation.
  4. Keys:

    • Correspondence: Keys in the ER model are mapped to primary keys in the relational model.
    • Mapping: The primary key of a relation uniquely identifies each row in the table, just as a key in the ER model uniquely identifies each entity.

Alternative Mappings:

  • In some cases, an ER construct can have multiple possible mappings to the relational model. For example, a multi-valued attribute in the ER model can be represented as a separate relation with a foreign key relationship to the original entity, or as a composite attribute in the entity's table.

b)

Options for Mapping EER Model Constructs to Relations:

  1. Inheritance Hierarchies:

    • Option: Each subclass can be mapped to a separate relation with a foreign key referencing the superclass.
    • Conditions: This option works well when each subclass has distinct attributes and when queries need to access subclass-specific attributes individually.
  2. Aggregation:

    • Option: Aggregated objects can be mapped to separate relations, with foreign keys linking them to the main relation.
    • Conditions: This option is useful when complex objects are aggregated into higher-level entities and when queries need to access the aggregated objects separately.
  3. Specialization/Generalization:

    • Option: Specialized entities can be mapped to separate relations with a foreign key referencing the generalized entity.
    • Conditions: This option is suitable when specialized entities have additional attributes or relationships specific to their specialization, and when queries need to access specialization-specific attributes individually.
  4. Union Types:

    • Option: Union types can be represented as separate relations, each representing a possible option in the union.
    • Conditions: This option is applicable when entities can have multiple types and when queries need to access attributes specific to each type.

The choice of mapping options depends on the specific requirements of the application, the nature of the data model, and the desired querying and performance characteristics. The selected mapping should accurately represent the semantics of the EER model while ensuring efficient storage, retrieval, and manipulation of data in the relational model.

0 0

Discussions

Post the discussion to improve the above solution.