The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+2 votes
Let A and B be two entities in an E-R diagram with simple single-valued attributes. R1 and R2 are two relationships between A and B, where R1 is one to many and R2 is many to many. R1 has 2 attributes and R2 has 3 attributes. What is the minimum number of tables required to represent this situation in the relational model?
asked in Databases by Active (2.1k points) | 44 views
I think 3 is enough...?


3 is correct.

1 for A,1 for B and 1 for R2 (many to many relationship)

1 Answer

0 votes
Total 3 tables will be required.


1 Relation will be required for representing A. 1 will be required for B. Now since R1 is a one-to-many relationship, its attributes can be shifted to the many side(i.e. entity having total participation in this relationship).

And for many-to-many, always remember that we need another relation to represent it. This relation will consist of (primary key of A, primary key of B, attributes of R2).
answered by (283 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
47,881 questions
52,233 answers
67,653 users