edited by
34,043 views
58 58 votes

Let $E_1$ and $E_2$ be two entities in an $E/R$ diagram with simple-valued attributes. $R_1$ and $R_2$ are two relationships between $E_1$ and $E_2$, where $R_1$ is one-to-many and $R_2$ is many-to-many. $R_1$ and $R_2$ do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model?

  1. $2$
  2. $3$
  3. $4$
  4. $5$

9 Answers

Best answer
72 72 votes

We need a separate table for many-to-many relation.
one-to-many relation doesn't need a separate table and can be handled using a foreign key.
So, answer is $B$ - $3$ tables.

Reference: MIT notes.

edited by
36 36 votes

Minimum no. of table required:

Relationship Type                Participation# of Tables
1-1Both Side Partial2
1-11: Partial  1: Full1
1-mBoth Side Partial2
1-m1: Full       m: Partial1
1-m1: Partial  m: Full2
m-mBoth Side Partial3
m-mm: Partial m: Full3
m-mBoth Side Full3

m-1 relationship behave like 1-m . 

 

This question belongs to the 2 categories:


R1 :- it's 1-m(Both side Partial) relationship which need 2 tables 1 table foe E1 and other for E2(combine with R1 ) 

R2:- it's m-m(Both side Partial) relationship which need 3 tables 1 table for E1 , 1 table for R2 & 1 table for E2 . but E1 and E2 is already counted so, only remaining R2 is required .

Min. no. of table :- E1,E2,R2 = 3

edited by
15 15 votes

Answer is 3 tables

0 0 votes
Here the E1 and E2 when connected by R1 needs only two table because it can be easily solved by using concept of foreign key.

When we are connected the same E1 and E2 (E2 having a foreign key through E1), we need a third table which will help in identifying the many-many relationship between E1 and E2 through R2
Answer:
Position:
Show:

Related questions

197 197 votes
9 answers 9 answers
77.0k
77.0k views
Kathleen asked Sep 22, 2014
76,994 views
A $5$ stage pipelined CPU has the following sequence of stages:IF – instruction fetch from instruction memoryRD – Instruction decode and register readEX – Execute: ALU op...
32 32 votes
3 answers 3 answers
15.3k
15.3k views
gatecse asked Sep 21, 2014
15,264 views
Let $f(x)$ be the continuous probability density function of a random variable $x$, the probability that $a < x \leq b$, is :$f(b-a)$$f(b) - f(a)$$\int\limits_a^b f(x) dx...
61 61 votes
5 answers 5 answers
28.6k
28.6k views
Kathleen asked Sep 22, 2014
28,591 views
The following table has two attributes $A$ and $C$ where $A$ is the primary key and $C$ is the foreign key referencing $A$ with on-delete cascade.$$\begin{array}{|c|c|} \...
79 79 votes
6 answers 6 answers
25.7k
25.7k views
Kathleen asked Sep 22, 2014
25,736 views
Let r be a relation instance with schema R = (A, B, C, D). We define $r_1 = \pi_{A, B, C} (R)$ and $r_2=\pi_{A, D} (r)$. Let $s =r_1 \: * \: r_2$ where $*$ denotes natura...