GATE CSE
First time here? Checkout the FAQ!
x
+3 votes
521 views

Consider the relation R1( P, Q, R, S ) and R( R, G, T, U )
The relation R1 has 20 tuples and R2 has 10 tuples then maximum number of tuples in R⟕ R2 is .......................?

asked in Databases by Loyal (4.4k points) 6 39 85
retagged by | 521 views

2 Answers

+4 votes

Since candidate key not define so max tupple will be 20*10 = 200.

if R1 has candidate key P and R2 has candidate key R .

then No. of max tupple will be depend on foriegn key attribute relation so here  R⟕ R2 = 20

answered by Veteran (53k points) 21 72 327
but think about a situation when r is the foreign key in R2 which is refrenced by R of the R1 and all the tuples of R of the R2 are same then we have to find maxm so 29 tuples will be there
that case assumes R is the candidate key in R1- which is not given and usually keys are given at left end though this s not a rule. Anyway, question is incomplete.
@anirudh as u said that when P is candidate key for R1 and R is the candidate key for R2 then in question there should also guven the condition that on whch tuple we are left joining the both the tables
Quetion is incomplete ,,, I take one assumption, i Wrote there word "if".

Arjun Sir M not make any rule i just take one assumption .
@Anirudh my reply was to saket. i.e., for taking R as key in R1.
+3 votes

here,nothing is given about referential integrity so,we apply some case

CASE 1 (default): All values of R1(R) and R2(R) are same then 20*10=200

CSAE 2: suppose R2(R) references  R1(R) (foreign key) and all the values are same in  R2(R)  then,

             1 tuple of R1(R)  matches with 10 tuples of  R2(R) then no of combination=10

          and 19 tuples left in  R1 which also come in resultant table with NULL values for  R2 tables attributes value

          so,19 no of more tuples

         so, total =10+19=29

CASE 3: if we change RI make  R1(R) references  R2(R) then if all values R1(R)  is same 

                     then, also as in case 2, i.e. 20+9=29

CASE 4: if r be act as primary key (unique) for both the table then for EX

             R1

P Q R S
a d 1 o
b e 2 u
c f 3 g

 

R2

R G T U
4 k n q
5 l o r
6 m p s

 

R1(leftouter join)R2

P Q R S R G T U
a d 1 o n n n n
b e 2 u n n n n
e f 3 g n n n n

 

so,all left part of table present with null values is right part of table

so,cardinality of left table will be maxm no of tuples so, 20 will be maxm

 

answered by Loyal (4.4k points) 6 39 85
edited by
Question is for LEFT outer join - so case 3 will be 20 + 0 = 20.


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users Oct 2017
  1. Arjun

    23678 Points

  2. Bikram

    17268 Points

  3. Habibkhan

    8950 Points

  4. srestha

    6446 Points

  5. Debashish Deka

    5478 Points

  6. jothee

    5128 Points

  7. Sachin Mittal 1

    4882 Points

  8. joshi_nitish

    4486 Points

  9. sushmita

    4032 Points

  10. Rishi yadav

    3974 Points


Recent Badges

Popular Question Hira Thakur
Notable Question amaity
Notable Question srestha
Nice Answer Madhab
Renewal Madhab
Popular Question sourabh
Notable Question K ANKITH KUMAR
Great Answer saloni
Resurrection saloni
Great Question Ishrat Jahan
27,406 questions
35,255 answers
84,502 comments
33,454 users