edited by
10,602 views
30 votes
30 votes

Consider the following $\text{ER}$ diagram

The minimum number of tables needed to represent $M$, $N$, $P$, $R1$, $R2$ is

 Which of the following is a correct attribute set for one of the tables for the minimum number of tables needed to represent $M$, $N$, $P$, $R1$, $R2$?

  1. ${M1, M2, M3, P1}$
  2. ${M1, P1, N1, N2}$
  3. ${M1, P1, N1}$
  4. ${M1, P1}$
edited by

2 Answers

Best answer
37 votes
37 votes

First strong entity types are made to tables. So, we get two tables $\text{M}$ and $\text{P}$.

I assume $\text{R1}$ is $1:1$ or $1:n$ as that would minimize the number of tables as asked in question. 

Now participation of $M$ in $R1$ is total (indicated by double arrow) meaning every entity of $M$ participate in $R1$. Since $R1$ is not having an attribute, we can simple add the primary key of $P$ to the table $M$ and add a foreign key reference to $M$. This handles $R1$ and we don't need an extra table. So, $M$ becomes $\text{{M1, M2, M3, P1}}$. 

$N$ here is a weak entity weakly related to $P$. So, we form a new table $N$, and includes the primary key of $P (P1)$ as foreign key reference. Now $(P1, N1)$ becomes the primary key of $N$. 

Thus we get $3$ tables.

$M$: ${M1, M2, M3, P1}$ - $M1$ primary key, $P1$ references $P$

$P$: ${P1, P2}$ - $P1$ primary key

$N$: ${P1, N1, N2}$ - $(P1, N1)$ primary key, $P1$ references $P$. 

So, answers is $A$. 

edited by
Answer:

Related questions

64 votes
64 votes
6 answers
1
Kathleen asked Sep 11, 2014
26,149 views
Consider the following $\text{ER}$ diagramThe minimum number of tables needed to represent $M$, $N$, $P$, $R1$, $R2$ is$2$$3$$4$$5$
50 votes
50 votes
6 answers
4
Kathleen asked Sep 12, 2014
21,466 views
A B-tree of order $4$ is built from scratch by $10$ successive insertions. What is the maximum number of node splitting operations that may take place?$3$$4$$5$$6$