722 views

2 Answers

1 votes
1 votes
R
A B
    1     5
    2     6
   3     7
   4

    8

  S
B C
    5     1
   6     2
   7     3
   9     8

now ATTRIBUTE C  in schema S is renamed as A 

FROM NOW C=A for schema   S

and every attribute of A  have to be CROSS PRODUCTED with attribute of B in schema S that is

S(A,B)
A B
         1         5 
         1         6
         1         7
         1         9
         2         5
         2         6
         2         7
         2         9
         3        5
         3        6
         3        7
         3        9
         8        5
         8        6
         8        7
         8        9

NOW we have to find its INTERSECTION  with R 

R INTERSCTION S(A,B)
A B
                 1                    5
                 2                    6
                 3                    7

 so this nothing but the natural join of R and S

∮ formula should be just R.B= S.B

edited by
1 votes
1 votes

R.A=S.C

Even it seems that natural join conition ie R.B=S.B will do, it is not the case. Let us assume that the required condition is R.B=S.B. 

now:

A B
1 2
1 1
1 3

 

B C
2 3
2 6
3 4

 

1st expression gives : 

A B
1 2
1 3

 

2nd expression gives: 

null

So, both are not equivalent. Ntural join condition would work only if A and C has at least one common value.

The actual answer is R.A=S.C

Related questions

17 votes
17 votes
4 answers
1
4 votes
4 votes
0 answers
2