2 votes 2 votes Databases virtual-gate-test-series analytical-aptitude gateforum-test-series + – dheerajgudipati asked Jan 3 dheerajgudipati 337 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 1 votes 1 votes 8 tuples are returned. R=A $\cup$ B A.ID A.Name A.Age 5 Bala 19 10 Akash 21 15 Raj 18 20 Babbar 16 25 Monty 20 3 Rohan 12 8 Rahul 22 R $\times$ C A.Id A.Name A.Age C.ID C.Name C.Age 5 Bala 19 9 Manish 19 5 Bala 19 18 Billu 22 10 Akash 21 9 Manish 19 10 Akash 21 18 Billu 22 ... ... ... ... 25 Monty 20 9 Manish 19 25 Monty 20 18 Billu 22 8 Tuples returned after filtering. minimalist answered Jan 4 • selected Jan 4 by dheerajgudipati minimalist comment Share Follow See all 7 Comments See all 7 7 Comments reply Show 4 previous comments Mrityudoot commented Jan 4 reply Follow Share I cant seem to understand it. Please correct me wherever Im taking a wrong turn We are taking Join of A U B with C Taking Cartesian should give 8*2 = 16 rows right? Then filtering For all the rows where C.ID = 9 (8 tuples) and all the rows where A.ID = 25 (2 tuples) We have 10 rows. One of this is common to both conditions i.e A=25, C=9 So effectively we should get 9 tuples no? 0 votes 0 votes minimalist commented Jan 4 reply Follow Share 8 tuples are returned.I wrote as final answer. Didn’t mean for A $\cup$ BYou guys thought as for union…A $\cup$ B returning 7 tuples, After crossing with 2 tuples of C returning 14 tuples. Now condition applicable on 8 tuples. That’s why final answer as 8.Hope it’s clear now...@dheerajgudipati @Mrityudoot 1 votes 1 votes Mrityudoot commented Jan 4 reply Follow Share @minimalist yep man all good now. Thanks 1 votes 1 votes Please log in or register to add a comment.
1 votes 1 votes A U B has 7 tuples (ID = 3,5,8,10,15,20,25) It is joined to C on the condition : EITHER A.id > 20 in A U B (Which is A = 25) OR C.id < 10 in C (Which is C =9) 2 tuples are returned. ID Name Age 25 Monty 20 9 Manish 19 Mrityudoot answered Jan 4 Mrityudoot comment Share Follow See 1 comment See all 1 1 comment reply minimalist commented Jan 4 reply Follow Share If the equality condition had been then 3(common columns) or 6(All columns) could have been based on the convention followed (author dependent). But other than equality conditions irrespective of column name(same or different) all columns of join tables have to be included. 0 votes 0 votes Please log in or register to add a comment.