0 votes 0 votes consider the relation r1(P,Q,R) and r2(R,S,T) with primary key P and R respectively. r1 contain 2000 tuples and r2 2500 tuples. max size of natural joint of r1 and r2..? plz explain.. dhairya asked Jun 16, 2016 dhairya 1.4k views answer comment Share Follow See 1 comment See all 1 1 comment reply rude commented Jun 16, 2016 i edited by rude Jun 16, 2016 reply Follow Share The max size will be Min $(2000, 2500) = 2000$ tuples. Here is the reference. 1 votes 1 votes Please log in or register to add a comment.
Best answer 4 votes 4 votes See here R is common in both the relation .Also R is key in the second relation .In second relation R will have 2500 distinct value. Also Relation r1 has 2000 tuple .So here every tuple in relation r1 will map with the relation r2 .So it will give result 2000 tuple. So Maximum size of R1⋈ R2 =2000 Also Minimum tuple in R1⋈ R2 =2000 ManojK answered Jun 16, 2016 • reshown Jun 16, 2016 by ManojK ManojK comment Share Follow See all 25 Comments See all 25 25 Comments reply dhairya commented Jun 16, 2016 reply Follow Share 2000 tuples of r1 will map to r2. 500 are distinct tuples...ryt...?? why the max size will be 2000.. :'( can u plzzzzzzzzzzzz elaborate 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share why 500 relation r2 has key R so 2500 different value for attribute R.rt? Now r1 has also attribute R which is common in both the relation but r1 has 2000 tuple only rt. So all the common attribute will result in natural join ok. 0 votes 0 votes dhairya commented Jun 16, 2016 reply Follow Share that means whatever the common tuples are the... suppose it would have been 2300 for r1.. then max size of natural joint would be 2300...ryt..? 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share yes Here off course 2300 tuple. I would suggest you take an example with less number of tuple .Then every thing will be clear. 0 votes 0 votes dhairya commented Jun 16, 2016 reply Follow Share @manojk see " http://quiz.geeksforgeeks.org/gate-gate-cs-2004-question-14/ " here..it is clearly shown that 5 entries are there in relation of natural joint of student and enrol..then how cm max is 8..?? 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share He has taken 5 tuple as an example to clear the idea .But here are 8 tuple in Enroll relation. So all 8 tuple will result in natural join. 0 votes 0 votes dhairya commented Jun 16, 2016 reply Follow Share ohhh..yahhhhhhh.... how stupid am i..:P 1 votes 1 votes dhairya commented Jun 16, 2016 reply Follow Share and min and max will be same ...?? 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share Yes but with restriction if there is no foreign key then min tuple will be 0. 0 votes 0 votes dhairya commented Jun 16, 2016 reply Follow Share ya ..ok... If 2 relation has a same primary key.. ( http://quiz.geeksforgeeks.org/gate-gate-cs-2004-question-14/ ) then it will not consider as foreign key...? 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share yes see this too https://gateoverflow.in/1011/gate2004_14 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share @dhairya still any confusion ? 0 votes 0 votes dhairya commented Jun 16, 2016 reply Follow Share in that link which u have provided...same as i have given u... but answers are different... 0 votes 0 votes dhairya commented Jun 16, 2016 reply Follow Share in ur link why " Enroll table rollno is FK " why not they have taken student's rollno as foreign key..?? 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share follow gate overflow link. min will 0 when it is explicitly specified in question that there is no foreign key constraint . 0 votes 0 votes dhairya commented Jun 16, 2016 reply Follow Share in ur link why " Enroll table rollno is FK " why not they have taken student's rollno as foreign key..?? 0 votes 0 votes vijaycs commented Jun 16, 2016 reply Follow Share @ManojK ... if your assumed foreign key elements( R of r1) all are different from the elements of table r2..then what would be min ?? 0 votes 0 votes dhairya commented Jun 16, 2016 reply Follow Share min would be 0... ryt @manojk...?? 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share @vijay foreign key elements( R of r1) all are different from the elements of table r2 ? then what is foreign key meant for ? 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share No min will be 8. 0 votes 0 votes dhairya commented Jun 16, 2016 reply Follow Share ohh..ya..al the tupls of foreign key will be there in other relation which it is refering to.. ryt..? 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share @dairya i already told you it will return 0 when there is no foreign key .and there will be no common attribute in the relation. 0 votes 0 votes ManojK commented Jun 16, 2016 reply Follow Share I should provide one line for answering this question.Then only it will be clear .Instead of up voting you down voting the answer.Ok No problem.If you have still any doubt you can ask. 0 votes 0 votes dhairya commented Jun 17, 2016 reply Follow Share thanxxxx manojk i got it now....:) 1 votes 1 votes ManojK commented Jun 17, 2016 reply Follow Share thank you . 0 votes 0 votes Please log in or register to add a comment.