12,238 views
49 49 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
40 40 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:
Position:
Show:

Related questions

91 91 votes
8 answers 8 answers
47.9k
47.9k views
Kathleen asked Sep 18, 2014
47,934 views
Consider the following relation schema pertaining to a students database:Students (rollno, name, address)Enroll (rollno, courseno, coursename)where the primary keys are s...
55 55 votes
6 answers 6 answers
14.2k
14.2k views
Kathleen asked Sep 18, 2014
14,179 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 eveneven ...
50 50 votes
7 answers 7 answers
21.3k
21.3k views
Kathleen asked Sep 18, 2014
21,299 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$
38 38 votes
5 answers 5 answers
26.4k
26.4k views
Kathleen asked Sep 18, 2014
26,424 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$