2,228 views
3 votes
3 votes

Consider the following relation:
R (A B C) A primary key with 100 tuples.
S (E F G) E primary key with 50 tuples.
T (AE D) AE primary key with 80 tuples.
U (D G H) H primary key with 10 tuples.
The maximum number of possible records in the result of  _______.

3 Answers

3 votes
3 votes
R NATURAL JOIN S returns max 5000 rows (As they do not have any Common attribute)

(R NATURAL JOIN S) NATURAL JOIN T returns max 80 Rows

((R NATURAL JOIN S) NATURAL JOIN T) NATURAL JOIN U returns 800 rows.
1 votes
1 votes

IN R (ABC) and S (EFG)  

tables are not referring or referred to each other, no common attributes 

image

100*50=5000 tuples

 

Now, as we move further 

R Join S Join T, here we have primary key A of R, E of S, and AE of T we see we have something in common.

5000 and 80 we get 80 

Now, as we move further 

{R Join S Join T} Join U

NOTE: Natural join lets you combine the relationships associated with a foreign key.

so U (D G HH primary key, obviously D and G attributes are referring to the table so they got something in Common 

80 and 10 gives 10 

Answer is 10

0 votes
0 votes

 

after R join S we have all 5000 different combination of A E in our new table say 1

now 1 join T will give 80 different combination  present in T, how – as A E is key in T  which will be compared with all possible combination of AE in best case our all 80 will match and will give 80 tuples , now name the result relation as 2

now key point for max tuples - for max tuples always think of duplicate values of common attribute in the relation in which our common attribute is not key .

here is not key attribute in our both tables (2 and U ) so we can duplicates its value in any of the table for max number of tuple, now your aptitude will come in handy (think on your own now if possible)

2 join U = we have 80 tuples in 2 for maximum match i’m assuming all the G values are same (say 0) and also in U all G values are 0.when our 2’s G is compare with U’s G .

1st tuple of 2 matches with all of U because both have G as 0 and give u 10 tuples

for every 80 tuples there will be 10 tuples in join so resultant table will have 800 tuples.

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
0 answers
2
kd..... asked Apr 30, 2019
659 views
Here why does the 5th query select * from employees natural join works_on where PID = 'X' AND PID='Y'; is not workingThe queries are The output are