edited by
7,748 views
2 votes
2 votes

Suppose ORACLE relation $R(A,B)$ currently has tuples $\{(1,2), (1,3), (3,4)\}$ and relation $S(B,C)$ currently has $\{(2,5), (4,6), (7,8)\}$.Consider the following two SQL queries SQ1 and SQ2:

SQ1:    Select * From R Full Join S On R.B=S.B;
SQ2:    Select * From R Inner Join S On R.B=S.B;

The numbers of tuples in the result of the SQL query SQ1 and the SQL query SQ2 are given by:

  1. $2$ and $6$ respectively
  2. $6$ and $2$ respectively
  3. $2$ and $4$ respectively
  4. $4$ and $2$ respectively
edited by

2 Answers

Best answer
4 votes
4 votes
inner join gives the record of two tables based on = condition

here R.B=S.B holds for 2 records when B=2 and B=4 hence its result w hence 2

for SQ2 Full Join or full outer join gives the result of left outer join(all rows of left table whether there is match or not) + right outer join( all rows of right table whether there is match or not with the left) now both table has 3 records but there are 2 match and 2 mismatch

hence SQ1 will give 4 records

so ans is choice D
selected by
1 votes
1 votes
I think inner join is same as natural join only difference Herr column name is given..

So it will return 2 tuples

1 2 5 and 3 4 6 from R.

Full join is similar to full outer join..

So it will result 4 tuples..

1 2 5 , 3 4 6, 1 3 null , null 7 8
Answer:

Related questions

2 votes
2 votes
1 answer
2
2 votes
2 votes
2 answers
3
go_editor asked Aug 11, 2016
4,123 views
Consider the following three tables $R, S$ and $T.$ In this question, all the join operations are natural joins $(\bowtie )$. $(\pi )$ is the projection operation of a re...