Question

In: Computer Science

What are the different options for converting a subtype-supertype hierarchy to relational tables?

What are the different options for converting a subtype-supertype hierarchy to relational tables?

Solutions

Expert Solution

Answer:

A supertype is a generic entity type that has a relationship with one or more subtypes.

A subtype is a sub-grouping of the entities in an entity type that is meaningful to the organization and that shares common attributes or relationships distinct from other subgroups.

  • Subtypes inherit all supertype attributes.

  • Subtypes have attributes that are different from other subtypes.

There are three basic options a designer considers when mapping these structures to a relational tables:

  1. Create a relation for each entity type in the hierarchy.
  2. Create relations for only the bottom-most entity types.
  3. Create one relation to represent the whole hierarchy.

1. Relations for All Entity Types

With this option each entity type in a hierarchy is represented by its own relation. Important points here are that

  • All relations representing entity types in the same hierarchy have the same primary key.
  • The primary key of a subtype relation will also be a foreign key that references its supertype relation.
  • Attributes of a supertype (except for the primary key) appear only in the relation that represents the supertype.

2. Relations for Bottom-Most Entity Types

In this case relations are created for only entity types that are at the “bottom” of the hierarchy. There are no relations created for a supertype. Important points here are that

  • All relations derived from entity types in the same hierarchy will have the same primary key.
  • No primary key value can be repeated (We have not seen how to handle this in MS Access. Further study of relational systems can include techniques that automate the checking for this kind of integrity constraint.)
  • Attributes of a supertype must be included in each of its subtype relations.

3. One Relation Representing the Whole Hierarchy

When this option is applied one relation is created for a complete hierarchy. All attributes appearing in the hierarchy are placed in one relation. Note that the value of a discriminator attribute will enable the user to know easily the subtype of a particular entity. For our example models, when we map a hierarchy to a single relation we obtain very simple relational designs.

Please give thumbsup, or do comment in case of any query. Thanks.


Related Solutions

QUESTION: The following tables describe the content of a relational database: a) Identify and classify the...
QUESTION: The following tables describe the content of a relational database: a) Identify and classify the tables as either entity or relationship The first step in building an E-R model is to identify the entities. Having identified the entities, the next step is to identify all the relationships that exist between these entities. Using the content of the relational database above: b) Using the relations in the relational database, explain how one can transform relationship in E-R model into a...
Describe the steps involved in converting an entity-relationship diagram to a set of normalised tables.
Describe the steps involved in converting an entity-relationship diagram to a set of normalised tables.
Describe enzyme regulation: Direct vs Indirect, and each subtype. Describe what the regulatory molecules are, different...
Describe enzyme regulation: Direct vs Indirect, and each subtype. Describe what the regulatory molecules are, different names to describe each type of regulation (i.e. feedback regulation, allosteric regulation, etc.), and what types of reactions each are (catabolic or anabolic).
There are various selection structures that can be used in programming. What are the different relational...
There are various selection structures that can be used in programming. What are the different relational operators used in selection structures in the Python programming language? Also, explain what short-circuiting is with respect to compound conditional expressions in Python. Provide examples to support your response in addition to constructive feedback on the structures and circumstances posted by your peers. Provide at least one reference to support your findings.
Use MYSQL to create the set of database tables of the relational database model and complete...
Use MYSQL to create the set of database tables of the relational database model and complete the associated queries given. Procedure: 1) Write all the SQL statements, necessary to create all tables and relationships, with Primary & Foreign keys. 2) Execute each statement in the correct order to create the relational database in MYSQL. 3)Insert some data into each table. 4) Use all your SQL create and Insert statements (from MS Word) to execute in the MYSQL WorkBench 5) Write...
Create an ER diagram, a Relational Schema, and tables with Data, based on the following requirements:...
Create an ER diagram, a Relational Schema, and tables with Data, based on the following requirements: The database will keep track of students and campus organizations. - For each student, we will keep track of his or her unique student ID, and his or her name and gender. - For each organization, we will keep track of its unique organization ID and the location. - Each student in the database belongs to at least one organization and can belong to...
One of the characteristics of good relational database design is normalized tables. Discuss two ways in...
One of the characteristics of good relational database design is normalized tables. Discuss two ways in which normalization helps minimize data redundancy and anomalies such as insertion, deletion, and update anomalies. What are some other characteristics of good database design?
Task 2 (1 mark) Transformation of data stored in the relational tables into data stored in...
Task 2 (1 mark) Transformation of data stored in the relational tables into data stored in BSON collection.
The following tables form part of a database (Flights Database) held in a relational DBMS: employee...
The following tables form part of a database (Flights Database) held in a relational DBMS: employee (empNo, empName, empSalary, empPosition) aircraft (aircraftNo, acName, acModel, acFlyingRange) flight (flightNo, aircraftNo, fromAirport, toAirport, flightDistance, departTime, arriveTime) certified (empNo, aircraftNo) Where:  employee contains details of all employees (pilots and non-pilots) and empNo is the primary key;  aircraft contains details of aircraft and C is the primary key.  flight contains details of flights and (flightNo, aircraftNo) form the primary key.  certified...
The following tables form part of a database held in a relational DBMS: Hotel (hotelNo, hotelName,...
The following tables form part of a database held in a relational DBMS: Hotel (hotelNo, hotelName, hotelAddress, country) Room (roomNo, hotelNo, type, price) Guest (guestNo, guestName, guestAddress, country) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Write the SQL statements for the following questions: 1. List the rooms that are currently unoccupied at the Grosvenor Hotel, for: (a) Use 2019-10-01 as today's date. Include all 'Grosvenor' hotels. List in hotelNo, roomNo order. Use NOT IN to perform the difference operation (b) Use...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT