The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+15 votes
1.5k views

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$
asked in Databases by Veteran (59.5k points)
edited by | 1.5k views
+1

Notice line --> simple-valued attributes.

If it is  "simple valued attribute" then answer may change.  

@Anu007 ji,

For ex. -> If $E_{1}$ has only one attribute then no need to create a separate table for it. 

0
explain that also how will change?
0

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

original question

thats y i am saying you are not considred multivalue attribute.

0

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

2 Tables. 

0

https://www.geeksforgeeks.org/gate-gate-cs-2005-question-75/
visit this link for better explanation

0

Anu007, dont you think answer of this question depends upon the participation(either total or partial) of a entity set.

suppose $R2$ is both side with total participation and $R1$ is total participation from the $1$ side then we need two tables

$E1R2E2$ and $E2R1$

+2

Since particiation is not given , we need to assume partial only.

2 Answers

+25 votes
Best answer

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: http://web.cse.ohio-state.edu/~gurari/course/cse670/cse670Ch9.xht

answered by Veteran (357k points)
edited by
+1
for the relation R1 , can't we need to check whether E2 is fully dependent on E1? because if E2 is not fully dependent to E1 then we have to insert null entries into the table.
0
Can you give an example?
0

@Arjun Sir,

yes if E2(we have assumed E2 to E1 is many to one) is not fully participating in the relation R1 then for some entry in the table (which is for E2R1 consisting of all attributes of E2 and primarykey of E1 as the reference key)the reference attribute to E1 will remain null. but will that create any problem Arjun Sir? because reference key remain  blank right? but in the many to many relation R2 if we try to do the same thing that is table consisting of all attributes from E1 and primary key of E2 then the table's primary key will become the combination of E1's primary key and E2 's primary key.. and since E1 is not fully participating in the relation for some entry in E2's primary key attribute will remain null and here both E2's primary key attribute and E1's primary key attribute are the primary key in the table so key attribute will become null which is not allowed so different table for R2 and E1. but we could have merged this table into a single if E1's participation had been full(though would have violated 2NF). 

and by the way what is the official key answer  3 or 4 ?Because NPTEL ER  lecture says until one entity is fully participating we have to make a separate table for relation and entity.. 

0
Foreign key can remain null - no issue with that.

Can you link to the NPTEL video of that?

Before 2011 there was no official key for GATE
0
R2 does not have any attribute..then why we need seperate table??
0
@Arjun Sir,

here is the link of NPTEL video
0
So in many to many case if there is not total participation then..how is the merge is possible??
+2

@vaishali we cant merge for " in many to many case if there is not total participation"
   

0
Ya..So here minimum no of table is asked that's why we are merging ?
0
^ we r merging for 1:m not for m:n  ....
0
I mean...for the relationship R2 if we make a table then primary key of R2  will be the union of primary keys of R1 and R2 ,if there is not a total paticipation then somewhere in keys null value could be present then how we make the table for R2?
+5


hope it helps u...:)

0
DOES MAPPING EFFECT THE TABLE USED?????
0
Update the reference ...
–3 votes

Answer (c)
The situation given can be expressed with following sample data.

E1
a
b
c

E2
x
y
z

R1
E1  E2
a    x
a    y
b    z


R2
E1   E2
a     x
a     y 
b     y 
answered by (13 points)
Answer:

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

39,619 questions
46,721 answers
140,295 comments
58,009 users