1,228 views
4 votes
4 votes

For the relation instances A and B, A/B is the largest relation instance Q such that Q × B ⊆ A. Consider A has exactly two fields x and y and B has just one field y with the same domain as in A. Division operation A/B is defined as the set of all x values (in the form of unary tuples) such that for every y value in (a tuple of) B, there is a tuple (x, y) in A. A/B can be defined using the algebra expression.

(A) πx(A) - πx((πx(A) × B) - B)
(B) πx(A) - πx((πx(B) × A) - B)
(C) πx(A) - πx((πx(A) × B) - A)
(D) πx(A) - πx((πx(B) × A) - A)

2 Answers

1 votes
1 votes

Ans is Option C.

If we consider A/B then and A(x,y) and B(y)

Division Operation gives those values of x from A,  where each value y in B gives one value of x.

Let's take an example

Table A
x y
a1 b1
a1 b2
a2 b1
a2 b2
a3 b3
Table B
y
b1
b2

 

 Then A/B gives ans 

A/B
x
a1
a2

This is correctly calculated by only option C. Check It.

0 votes
0 votes

To understand the answer it is necessary that you understand the meaning of division operation – “Division operation A/B is defined as the set of all x values (in the form of unary tuples) such that for every y value in (a tuple of) B, there is a tuple (x, y) in A”

lets think meaning of everything  lets B is relation with different values of Y here let assume here Y = (1,2,3)

and Relation A have tuples in which x is paired with different values of Y –  some x are paired with some value of y and some are paired with every value of Y. example A = {(a,1)(b,1)(b,2)(c,1)(c,2)(c,3)} here you can see that C is paired with all value of Y then answer of A/B will be 

now how to obtain this result with basic operations..

clearly, I know that i have to remove the tuples with only some values of Y but unfortunately i cant remove them directly 

but we can remove the tuples which are paired up every value of B(Y) how?

first we  π_x (A) × B which will give us the tuples {(a,1)(a,2)(a,3)(b,1)(b,2)(b,3)(c,1)(c,2)(c,3)} so if I substract A from this will be completely delete from π_x (A) × B and we are left with tuples of a and b which we dont want so 

we substract them from our which will give out our answer that is 

hope it will help some 

Related questions

1 votes
1 votes
1 answer
1
raginibhayana asked Feb 15, 2022
757 views
why don't we use the projection operator in conditional join?
1 votes
1 votes
2 answers
3
aditi19 asked May 8, 2019
1,224 views
Suppliers(sid, sname, address)Parts(pid, pname, color)Catalog(sid, pid, cost)Find the pids of the most expensive parts supplied by suppliers named Yosemite Sham