# Relation algebra Query

1 vote
216 views

Consider the following relation and instance of relation:

Supply(sid,Sname)  #sid is key

Parts(pid,Pname,Pcolor)  #pid is the key

Catalog(sid,pid)  #sid,pid is the key

Number of tuples returned by the above Query is ……...

0
6?
0
Mine was 6 too but its 0
0
I think 100,null  on comparing with 100,5 will return false in SQL but not sure in RA. Maybe we have treat it the same here as well

Answer is 0. Bcoz no violet color in parts table.

(In cross product if any one of the table contains 0  record then no tuples will be selected.)
0

According to truthtable of subtraction

A B A-B
0 0 0
0 1 1
1 0 1
1 1 0

So,we will get 6 values.

0
what method is this? Can u explain?

## Related questions

1
227 views
Consider a relation R(A, B) that contains r tuples, and a relation S(B, C) that contains s tuples; assume r > 0 and s > 0. Make no assumptions about keys. For the following relational algebra expression, in terms of r and s the minimum and maximum number of tuples that could be in the result?
Given two relations R1 and R2, where R1 contains N1 tuples, R2 contains N2 tuples, and N2>N1> 0, give the minimum and maximum possible sizes (in tuples) for the result relation produced by each of the following relational algebra expressions. In each case, state any assumptions about ... difference) $R1 X R2$ (cartesian product) $σa=5(R1)$ (selection) $\pi a(R1)$ (projection) $R1/R2$ (division)