Let and be two entities in an diagram with simple-valued attributes. and are two relationships between and , where is one-to-many and is many-to-many. and do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model?
View worked solution
Answer: B
To find the minimum number of tables required to represent the given E/R diagram in the relational model, we analyze each component step-by-step:
-
Entities and :
Each entity with simple-valued attributes generally requires its own table to store its attributes.
- Let the table for have primary key .
- Let the table for have primary key .
-
One-to-Many Relationship :
In a (one-to-many) relationship, we do not need a separate table. Instead, we can merge the relationship into the table of the entity on the "many" () side by adding the primary key of the "one" side entity as a foreign key.
- For example, if the relationship is from to , we can represent by adding as a foreign key in the table for .
- Thus, , , and can be represented using just 2 tables:
-
Many-to-Many Relationship :
An (many-to-many) relationship cannot be merged into either of the entity tables without causing redundancy or violating normalization rules. Therefore, it always requires a separate table containing the primary keys of both participating entities as foreign keys.
Combining these, the minimum number of tables required is:
Hence, the minimum number of tables required is 3.
Free practice · Your answers on this page are not saved.
