• edited by
42,111 views
98 98 votes

An ER model of a database consists of entity types $A$ and $B$. These are connected by a relationship $R$ which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A?

  1. Relationship $R$ is one-to-many and the participation of $A$ in $R$ is total
  2. Relationship $R$ is one-to-many and the participation of $A$ in $R$ is partial
  3. Relationship $R$ is many-to-one and the participation of $A$ in $R$ is total
  4. Relationship $R$ is many-to-one and the participation of $A$ in $R$ is partial

7 Answers

Best answer
73 73 votes

The relation table for R should always be merged with the entity that has total participation and relationship should be many to one.

Answer is C.

• edited by
23 23 votes

(C) 

We need following two conditions:

  • A:B = Many to one
  • A has total participation

If A to B is many to one, then for each row in table A, the relationhip can be added as an extra column. Total participation ensures that there is no null values.

12 12 votes
|A|===== <R> ---------|B|

here relation R between A and B represent many to one with total participation at A entity,

this representation is same as definition of week entity, ans is C
2 2 votes

In relational database design, merging a relationship table $R$ into an entity table $A$ means adding the primary key of $B$ (as a foreign key) directly into table $A$.
 

1. Cardinality Constraint

For the table for $R$ to be merged with $A$, each entity in $A$ must be associated with at most one entity in $B$.

  • If an entity in $A$ could relate to multiple entities in $B$ (a one-to-many relationship from $A$ to $B$), merging them would violate the first normal form ($1\text{NF}$) because table $A$ would need to store multiple values of $B$'s primary key for a single row of $A$.

  • Therefore, the relationship $R$ from $A$ to $B$ must be many-to-one. This ensures that for every row in $A$, there is exactly one corresponding value from $B$ to place in that row's foreign key column.

2. Participation Constraint

Now we consider whether $A$'s participation in $R$ should be total or partial.

  • Total Participation: Every entity in $A$ must be associated with an entity in $B$. If we merge $R$ into $A$, every row in table $A$ will have a valid, non-null foreign key value pointing to $B$. This avoids any NULL values in the foreign key column.

  • Partial Participation: Some entities in $A$ do not participate in $R$. If we merge the tables, the rows in $A$ that don't participate in $R$ will have NULL values in the foreign key column. While this is technically possible in standard SQL, it is not considered a clean or ideal relational design due to NULL insertion.

To merge the table without introducing NULL values or structural issues, total participation is required.
 

Correct Answer: C. Relationship $R$ is many-to-one and the participation of $A$ in $R$ is total

Answer:
Position:
Show:

Related questions

53 53 votes
7 answers 7 answers
21.0k
21.0k views
Madhav asked Feb 14, 2017
20,979 views
In a $B^+$ Tree , if the search-key value is $8$ bytes long , the block size is $512$ bytes and the pointer size is $2\;\text{B}$ , then the maximum order of the $B^+$ Tr...
106 106 votes
8 answers 8 answers
31.5k
31.5k views
Madhav asked Feb 14, 2017
31,451 views
Consider the following tables $T1$ and $T2.$$$\overset{T1}{\begin{array}{|c|c|c|} \hline \textbf {P} & \textbf {Q} \\\hline \text {2} & \text{2 }\\\hline \text{3} & \te...
59 59 votes
5 answers 5 answers
18.4k
18.4k views
khushtak asked Feb 14, 2017
18,430 views
If $w, x, y, z$ are Boolean variables, then which one of the following is INCORRECT?$wx+w(x+y)+x(x +y) = x+wy$$\overline{w \bar{x}(y+\bar{z})} + \bar{w}x = \bar{w} + x + ...
56 56 votes
6 answers 6 answers
21.5k
21.5k views
khushtak asked Feb 14, 2017
21,477 views
In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed?ContiguousLinkedIndexed$1$ and $3$ only$2$ on...