in Databases retagged by
460 views
3 votes
3 votes

Let $r(X, Y)$ and $s(Y)$ be two relations.

What is returned by the following relational algebra query?

  1. Values of $r.X$ which are related to every value of $s.Y$.
  2. Values of $r.Y$ which are related to every value of $s.Y$.
  3. Values of $r.X$ which are not related to some value of $s.Y$.
  4. Values of $r.X$ which are not related to any value of $s.Y$.
in Databases retagged by
460 views

3 Comments

First cross product of ( projection X of r) and s means every r,x related to every s,y

then minus Original R

So , r.x  are subtracted in which r.x related to every y

and those are not related to every y are left 

So , Answer should be Values of r.x which are not related to every value of s.Y

not in option

3
3

@Aaveg537, Your analysis is correct, but conclusion is not. Option $C$ correctly describes your analysis.

“Values of r.X which are not related to every value of s.Y” is ambiguous as it could mean the values of r.X which are not related to any value of s.Y.

Read & Consider option $C$: “Values of r.X which are not related to some value of s.Y”. It is what we want. 

1
1
got it sir!!!!
0
0

2 Answers

5 votes
5 votes
First we compute the X-projection of $r$. Then we cross product with $s$, so,
$$
\left (\pi_X \;^{(r) \times s}\right).
$$
Will give us tuples $(\mathrm{X}, \mathrm{Y})$ where every value of $\mathrm{r} . \mathrm{X}$ is related to every value of $s.Y.$

Now we subtract actual tuples of $r$.

So, we will get those tuples $(\mathrm{X}, \mathrm{Y})$ which are NOT present in $r$. Now, we project $X$, So, we get those values of $r.X$ which are not related to some value of $s.Y.$
edited by
0 votes
0 votes

First cross product of ( projection X of r) and s means every r,x related to every s,y

 

then minus Original R

 

So , r.x are subtracted in which r.x related to every y

 

and those are not related to every y are left 

So , Answer should be Values of r.x which are not related to every value of s.Y

not in option

2 Comments

@Aaveg537, Your analysis is correct, but conclusion is not. Option $C$ correctly describes your analysis.

“Values of r.X which are not related to every value of s.Y” is ambiguous as it could mean the values of r.X which are not related to any value of s.Y.

Read & Consider option $C$: “Values of r.X which are not related to some value of s.Y”. It is what we want. 

1
1
thank you sir !!!!
0
0
Answer:

Related questions