Database Mapping

WorkableAtlanta avatar
WorkableAtlanta
·
·
Download

Start Quiz

Study Flashcards

39 Questions

What is the first step in the ER-to-Relational Mapping Algorithm?

Mapping of Regular Entity Types

What is the purpose of Step 1 in the ER-to-Relational Mapping Algorithm?

To create a relation with all the simple attributes of the entity type

What is chosen as the primary key for the relation R in Step 1?

One of the key attributes of E

What happens if the chosen key of E is composite in Step 1?

The set of simple attributes form the primary key

What is created in Step 2 for each weak entity type W?

A relation with all the simple attributes of W and foreign key attributes of the owner entity type

What are included as foreign key attributes of the relation R in Step 2?

The primary key attribute(s) of the relation(s) corresponding to the owner entity type(s)

What is the purpose of Steps 8 and 9 in the ER-to-Relational Mapping Algorithm?

To map specialization or generalization and union types

What is the result of mapping the COMPANY ER schema into a relational schema?

The creation of three relations: EMPLOYEE, DEPARTMENT, and PROJECT

What is the primary key of the DEPENDENT relation?

{ESSN, DEPENDENT_NAME}

Which approach is used to map a binary 1:1 relationship type?

Foreign Key approach

What is the purpose of Step 2 in mapping ER schema to relational schema?

Mapping of Weak Entity Types

What is the primary key of the relation DEPENDENT renamed to?

ESSN

Which entity type is chosen to serve in the role of S in a 1:1 relationship type?

Entity type with total participation

In a binary 1:N relationship type, where is the foreign key included?

In the relation S

What is included as attributes of S in a 1:N relationship type?

Simple attributes of the 1:N relation type

What is the result of mapping the COMPANY ER schema?

A relational schema

What is the primary key of R in the given ER model?

{DNUMBER, DLOCATION}

What is created to represent an n-ary relationship type R, where n>2?

A new relationship S

What is included as attributes of S in the mapping of an n-ary relationship type?

All of the above

What is the primary key of the relation SUPPLY in the relational schema?

{SNAME, PARTNO, PROJNAME}

What corresponds to a 'Relationship' relation in the relational model?

All of the above

What is mapped to a set of simple component attributes in the relational model?

Composite attribute

What is the mapping for a multivalued attribute in the relational model?

Relation and foreign key

What is the next step after mapping an n-ary relationship type?

Options for Mapping Specialization or Generalization

What is the primary key of the WORKS_ON relation in the relational database schema?

The combination of ESSN and PNO

What is the purpose of including the primary key DNUMBER of the DEPARTMENT relation as a foreign key in the EMPLOYEE relation?

To represent the M:N relationship type WORKS_FOR

What is included in the relation S to represent the M:N relationship type R?

The primary keys of the participating entity types and any simple attributes of the M:N relationship type

What is the primary key of the relation R created to map a multivalued attribute A?

The combination of A and K

Why is the attribute DLOCATION included in the relation DEPT_LOCATIONS?

To represent the multivalued attribute LOCATIONS of DEPARTMENT

What is the purpose of creating a new relation S to represent a binary M:N relationship type R?

To create a relation between the participating entity types

What is the primary key of the DEPT_LOCATIONS relation?

The combination of DLOCATION and DNUMBER

What is the main difference between Options 8A and 8B?

Option 8A creates a single relation for the superclass, while Option 8B creates a relation for each subclass.

What is the purpose of creating a relation L in Option 8A?

To store the attributes of the superclass.

What is common in the attributes of relations Li in Options 8A and 8B?

They all have the attribute k.

What is the limitation of using Option 8B?

It can only be used for total specialization.

What is the advantage of using Option 8C?

It requires less relations to be created.

What is the purpose of the attribute t in Option 8C?

To store the type of the entity.

Which option is suitable for mapping partial specialization?

Option 8A

What is the primary key of the relation L in Option 8C?

{k}

Study Notes

ER-to-Relational Mapping Algorithm

  • The algorithm consists of 9 steps to map ER diagrams to relational schemas
  • Steps 1-7 map ER model constructs to relations
  • Steps 8-9 map EER model constructs to relations

Step 1: Mapping of Regular Entity Types

  • For each regular entity type E, create a relation R with all simple attributes of E
  • Choose a key attribute of E as the primary key for R
  • If the chosen key is composite, the set of simple attributes that form it will together form the primary key of R

Step 2: Mapping of Weak Entity Types

  • For each weak entity type W, create a relation R with all simple attributes of W
  • Include the primary key attribute(s) of the owner entity type(s) as foreign key attributes of R
  • The primary key of R is the combination of the primary key(s) of the owner(s) and the partial key of W, if any

Step 3: Mapping of Binary 1:1 Relation Types

  • For each binary 1:1 relationship type R, identify the relations S and T that correspond to the entity types participating in R
  • Choose one of the relations, say S, and include a foreign key in S, the primary key of T
  • It is better to choose an entity type with total participation in R

Step 4: Mapping of Binary 1:N Relationship Types

  • For each regular binary 1:N relationship type R, identify the relation S that represents the participating entity type at the N-side of the relationship type
  • Include as foreign key in S the primary key of the relation T that represents the other entity type participating in R
  • Include any simple attributes of the 1:N relation type as attributes of S

Step 5: Mapping of Binary M:N Relationship Types

  • For each regular binary M:N relationship type R, create a new relation S to represent R
  • Include as foreign key attributes in S the primary keys of the relations that represent the participating entity types
  • Also, include any simple attributes of the M:N relationship type as attributes of S

Step 6: Mapping of Multivalued Attributes

  • For each multivalued attribute A, create a new relation R
  • R includes an attribute corresponding to A, plus the primary key attribute K as a foreign key in R
  • The primary key of R is the combination of A and K

Step 7: Mapping of N-ary Relationship Types

  • For each n-ary relationship type R, create a new relation S to represent R
  • Include as foreign key attributes in S the primary keys of the relations that represent the participating entity types
  • Also, include any simple attributes of the n-ary relationship type as attributes of S

Mapping EER Model Constructs to Relations

  • Step 8: Options for mapping specialization or generalization
  • Step 9: Mapping of union types (categories)

Step 8: Options for Mapping Specialization or Generalization

  • Option 8A: Multiple relations - superclasses and subclasses
  • Option 8B: Multiple relations - subclass relations only
  • Option 8C: Single relation with one type attribute
  • Option 8D: Single relation with multiple type attributes

This quiz is about mapping n-ary relationship types to new relationships in database design. Learn about the primary keys and foreign key attributes involved in this process.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Use Quizgecko on...
Browser
Browser