7,018 views
33 votes
33 votes

Let $R_1 \left(\underline{A}, B, C\right)$ and $R_2\left(\underline{D}, E \right) $ be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in $R_1$ referring to $R_2$. Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances $r_1$ and $r_2$. Which of the following relational algebra expressions would necessarily produce an empty relation?

  1. $\Pi_D (r_2) - \Pi_C (r_1)$

  2. $\Pi_C (r_1) - \Pi_D (r_2)$

  3. $\Pi_D \left(r_1 \bowtie_{C \neq  D}r_2\right)$

  4. $\Pi_C \left(r_1 \bowtie_{C = D}r_2\right)$

1 Answer

Best answer
28 votes
28 votes

Answer is (B).

$C$ in $R1$ is a foreign key referring to the primary key $D$ in $R2$. So, every element of $C$ must come from some $D$ element.

edited by
Answer:

Related questions

38 votes
38 votes
4 answers
2
Kathleen asked Sep 18, 2014
8,311 views
The following finite state machine accepts all those binary strings in which the number of $1$’s and $0$’s are respectively: divisible by $3$ and $2$odd and evene...
37 votes
37 votes
7 answers
3
Kathleen asked Sep 18, 2014
12,565 views
The minimum number of colours required to colour the following graph, such that no two adjacent vertices are assigned the same color, is$2$$3$$4$$5$
27 votes
27 votes
5 answers
4
Kathleen asked Sep 18, 2014
18,981 views
Let $A = 1111 1010$ and $B = 0000 1010$ be two $8-bit$ $2’s$ complement numbers. Their product in $2’s$ complement is$1100 0100$$1001 1100$$1010 0101$$1101 0101$