• edited by
16,427 views
48 48 votes

Consider two relations $R_1(A,B)$ with the tuples $(1,5), (3,7)$ and $R_2(A,C) = (1,7),(4,9)$.

Assume that $R(A,B,C)$ is the full natural outer join of $R_1$ and $R_2$. Consider the following tuples of the form $(A,B,C):$

$a = (1,5,null), b=(1,null,7), c=(3,null,9), d=(4,7,null), e=(1,5,7), $

$ f=(3,7,null),  g=(4,null,9).$

Which one of the following statements is correct?

  1. $R$ contains $a, b, e, f, g$ but not $c, d$.
  2. $R$ contains all $a, b, c, d, e, f, g$.
  3. $R$ contains $e, f, g$ but not $a, b$.
  4. $R$ contains $e$ but not $f, g$.

2 Answers

Best answer
69 69 votes
$R_1(A,B): \begin{array}{|c|c|} \hline \textbf{A} & \textbf{B} \\\hline \text {1} &  \text{5 }\\\hline \text{3} & \text{7} \\\hline \end{array}$

$R_2(A,C): \begin{array}{|c|c|} \hline \textbf{A} & \textbf{C} \\\hline \text {1} &  \text{7}\\\hline \text{4} & \text{9} \\\hline \end{array}$

Now , if we do full natural outer join:
$$\begin{array}{|c|c|} \hline \textbf{A} & \textbf{B} & \textbf{C}\\\hline \text {1} &  \text{5 } & \text{7}\\\hline \text{3} & \text{7} & \text{NULL} \\\hline  \text{4} & \text{NULL} & \text{9} \\\hline \end{array}$$
So, option (C) is correct.
• edited by
10 10 votes
Ans C. Full outer join means take all matching rows from left table and right table based on common columns.
Answer:
Position:
Show:

Related questions

97 97 votes
8 answers 8 answers
39.5k
39.5k views
go_editor asked Feb 13, 2015
39,471 views
Consider a simple checkpointing protocol and the following set of operations in the log.(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7)...
69 69 votes
4 answers 4 answers
24.1k
24.1k views
go_editor asked Feb 12, 2015
24,064 views
With reference to the $B^+$ tree index of order $1$ shown below, the minimum number of nodes (including the Root node) that must be fetched in order to satisfy the follow...
100 100 votes
12 answers 12 answers
27.4k
27.4k views
go_editor asked Feb 12, 2015
27,417 views
A Young tableau is a $2D$ array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with $\infty$, and hence there cannot be...
141 141 votes
7 answers 7 answers
40.5k
40.5k views
go_editor asked Feb 13, 2015
40,526 views
Which one of the following well-formed formulae is a tautology? $\forall x \, \exists y \, R(x,y) \, \leftrightarrow \, \exists y \, \forall x \, R(x, y)$$( \forall x \,...