in Databases edited by
366 views
1 vote
1 vote

Consider the following relations and query.
$$
\begin{gathered}
\textsf{r(A, B, C)}\\
\textsf{s(A, B, C)}\\
\sigma_{\textsf{A>C}}([(\textsf{r} \cup \text{s) - (r - s)] - (s - r))}
\end{gathered}
$$
Which of the following is equivalent to the above query?

  1. $\sigma_{\textsf{A>C}}(\textsf{r} \bowtie \textsf{s})$
  2. $\sigma_{\textsf{A>C}}(\textsf{r} \cup \textsf{s})$
  3. $\sigma_{\textsf{A>C}}(\textsf{r}) \cap \sigma_{\textsf{A>C}} (\textsf{s})$
  4. $\sigma_{\textsf{A>C}}(\text{r} \cap \textsf{s})$
in Databases edited by
366 views

1 Answer

1 vote
1 vote

From set theory or the Venn diagram, we can note that

$((\textsf{r} \cup \textsf{s) - (r - s) - (s - r)) = r}\cap \textsf{s}$

$\textsf{r} \cap \textsf{s = r - (r - s)}$

We can see that
$((\textsf{r} \cup \textsf{s) - (r - s) - (s - r)) = r} \cap \textsf{s}.$


edited by

2 Comments

Can you explain how option A is becoming true?
1
1
Its join so taking only intersection elements into account
0
0
Answer:

Related questions