ans plz

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+19 votes

Consider the join of a relation $R$ with a relation $S$. If $R$ has $m$ tuples and $S$ has $n$ tuples then the maximum and minimum sizes of the join respectively are

- $m+n$ and $0$
- $mn$ and $0$
- $m+n$ and $|m-n|$
- $mn$ and $m+n$

+30 votes

Best answer

Answer is **B**.

$mn$

**Case 1:** if there is a common attribute between $R$ and $S$, and every row of $r$ matches with the each row of $s$- i.e., it means, the join attribute has the same value in all the rows of both $r$ and $s$,

**Case 2: **If there is no common attribute between $R$ and $S.$

$0$ There is a common attribute between $R$ and $S$ and nothing matches- the join attribute in $r$ and $s$ have no common value.

+7

mn occurs during cartesian product of two relation ....

and 0 occurs during natural join of two realtion(In best case )....

and 0 occurs during natural join of two realtion(In best case )....

+20

^

Join means Natural Join only.

Natural Join gives result as cartesian product if no attribute is matching in both relations.

eg- $R(A,B)$ and $S(C,D)$

Natural Join gives result as empty relation if at least one of the attribute matches but value does not matches.

$\begin{tabular}{ |c|c| }

\hline \multicolumn{2}{|c|}{R} \\

\hline A & B \\

\hline a1 & b1 \\

a2 & b2

\\ a3 & b3 \\

\hline

\end{tabular}$

$\begin{tabular}{ |c|c| }

\hline \multicolumn{2}{|c|}{S} \\

\hline B & C \\

\hline b3 & c1 \\

b4 & c2 \\

b5 & c3 \\

\hline \end{tabular}$

In this case $R \Join S$ is empty.

Join means Natural Join only.

Natural Join gives result as cartesian product if no attribute is matching in both relations.

eg- $R(A,B)$ and $S(C,D)$

Natural Join gives result as empty relation if at least one of the attribute matches but value does not matches.

$\begin{tabular}{ |c|c| }

\hline \multicolumn{2}{|c|}{R} \\

\hline A & B \\

\hline a1 & b1 \\

a2 & b2

\\ a3 & b3 \\

\hline

\end{tabular}$

$\begin{tabular}{ |c|c| }

\hline \multicolumn{2}{|c|}{S} \\

\hline B & C \\

\hline b3 & c1 \\

b4 & c2 \\

b5 & c3 \\

\hline \end{tabular}$

In this case $R \Join S$ is empty.

- All categories
- General Aptitude 1.3k
- Engineering Mathematics 5.4k
- Digital Logic 2.1k
- Programming & DS 3.9k
- Algorithms 3.4k
- Theory of Computation 4.2k
- Compiler Design 1.6k
- Databases 3.1k
- CO & Architecture 2.7k
- Computer Networks 3.1k
- Non GATE 1.1k
- Others 1.4k
- Admissions 501
- Exam Queries 449
- Tier 1 Placement Questions 19
- Job Queries 62
- Projects 12

38,000 questions

45,496 answers

131,569 comments

48,633 users