# GATE2005-30

5.1k views

Let r be a relation instance with schema R = (A, B, C, D). We define $r_1 = \pi_{A, B, C} (R)$ and $r_2=\pi_{A, D} (r)$. Let $s =r_1 \: * \: r_2$ where $*$ denotes natural join. Given that the decomposition of $r$ into $r_1$ and $r_2$ is lossy, which one of the following is TRUE?

1. $s \subset r$

2. $r \cup s =r$

3. $r \subset s$

4. $r*s=s$

retagged
1

here if consider

R
A B C D
1 2 3 4
5 6 7 8
R1
A B C
1 2 3
5 6 7
R2
A D
1 4
5 8
S = R1 * R2
A B C D
1 2 3 4

5 6 7 8

now it satisfying option b & d kindly correct me where m wrong

9
Given that decomposition of r into r1 and r2 is lossy.. that means A (which is common attribute in r1 and r2) shouldn't be Key for any of relation.. but in your example A works as key for both r1 and r2..

Thats why u r getting option B or D..

Ryt ??
0
but it doesnot matter y cnt b & d just say
0
U r getting B or D in a particular case only, not always..
0
but to make false only 1 case is sufficient na then y not considering b & d???????????
0

is it proper subset ?

0

R(A,B,C,D):

A B C D
1 a b 2
1 c d 2
NULL e f 3

R1(A,B,C):

A B C
1 a b
1 c d
NULL e f

R2(A,D):

A D
1 2
NULL 3

S:

A B C D
1 a b 2
1 c d 2

S $\subset$ R

Answer is C $r \subset s.$

$$\overset{\text{r}}{\begin{array}{|l|l|l|l|}\hline \textbf{A} & \textbf{B} & \textbf{C} & \textbf{D} \\\hline \text{1} & \text{2} & \text{3} & \text{3} \\ \text{1} & \text{5} & \text{3} & \text{4}\\\hline \end{array}} \qquad \overset{\text{r1}}{\begin{array}{|l|l|l|l|}\hline \textbf{A} & \textbf{B} & \textbf{C} \\\hline \text{1} & \text{2} & \text{3} \\ \text{1} & \text{5} & \text{3} \\\hline \end{array}}\qquad\overset{\text{r2}}{\begin{array}{|l|l|l|l|}\hline \textbf{A} & \textbf{D} \\\hline \text{1} & \text{3} \\ \text{1} & \text{4}\\\hline \end{array}}\qquad\overset{\text{s = r1 * r2}}{\begin{array}{|l|l|l|l|}\hline \textbf{A} & \textbf{B} & \textbf{C} & \textbf{D} \\\hline \textbf{1} & \textbf{2} & \textbf{3} & \textbf{3} \\ \text{1} & \text{2} & \text{3} & \text{4}\\\text{1} & \text{5} & \text{3} & \text{4}\\ \textbf{1} & \textbf{5} & \textbf{3} & \textbf{4}\\\hline \end{array}}$$

All the rows of $r$ are in $s$ (marked bold). So, $r \subset s.$

And one more result $r * s = r.$

edited by
0
Arjun Sir,

Is this not the case that lossless-join property is also non-additive join property?

So, when we say that a decomposition follows the "lossless join property" ,it asserts that the "natural join of the decompositions of the relation should not result in spurious tuples(non-additive) or tuples lost(lossy property)".

Since in the above question, it is clearly mentioned that natural join is lossy, doesn't that mean that there are certain tuples lost. i.e s⊂r.

Hence  s⊂r poses me as an answer.

Please correct me if I have misinterpreted this.
15

Since in the above question, it is clearly mentioned that natural join is lossy, doesn't that mean that there are certain tuples lost. i.e s⊂r.
LOSSY JOIN MEANS THAT WE GET SOME EXTRA TUPLES WHICH ARE NOT PRESENT IN THE RELATION AND IT DOESNT MEAN THAT TUPLES ARE LOST..

7
@sushmita,-No. Lossy decomposition means that you would get your original result plus some extra tuples that do not belong to the original relation decomposed.

Now when these database tables are large, you wouldn't want to go and manually check for spurious tuples which arise out of such condition. That's why lossless decomposition is a desirable property of decomposition which enforces that common attributes of decomposition must be a key to any one of the sub-relation arising out of decomposition.

which you must have seen in books like

R1$\cap$R2 ->R1

or R1$\cap$R2 ->R2
0

In r2  A and D  not B

@Vikrant Singh

0
How r*s=r is true for lossy decomposition
0

Lossy simply stands for the consistency loss i.e. the relation before and after Decomposing and Natural Join(ing) are not same.

0
The second last row of S must be 1 5 3 3
0

Simply, lossless condition states that no extra information comes into the relation when we join two tables.

But, here decomposition (r1 &r2) is lossy, so, when we join tables extra tuples may come (spurious tuples).

Hence, S= r1*r2 may have extra info. $\therefore r\subset S$

in short what happens in lossy when you join the tables r1 ,r2 to form r you get the tuples already in r and also some extra tuples(spurious tuples) which makes the table ambiguous like a person having previously one address now its showing more than one address .so to conclude r is a subset of s..

http://stackoverflow.com/questions/12671362/lossy-decomposition

Here

decomposition of r to r1 and r2 is lossy.

Lossy decomposition :R1 and R2 has a common attribute but the common attribute A is not key in either of R1 or R2.

Due to this when R1 and R2 are joined,we get spurious tuples which are not in Original R.

s=r1*r2

C.rs

0
Short and clear logic
(a) (b) and (d)

Reason:

obviously c(r cannot be a subset of s, since r1 and r2 are lossy decomposition) not true

a should be true(since s cant have values outside r)

d(natural join takes common element) since a is true
3
How you are getting a, b ? Your answer is wrong !

## Related questions

1
120 views
Let $R(A,B,C)$ be a relation with primary key $(A)$ and $S(A, D, E)$ a relation with primary key $(A, D)$. Each of the relations has $n$ tuples. If the number of tuples in $R \: \text{ natural join } S$ is $m$, then determine the number of tuples in $R$ $\text{ natural left outer join } S$.
Q.1. Does theta join operator requires following union compatibility requirements?: Same number of columns Domain of corresponding columns should be same I feel no, since I came across following fact: $\sigma_\theta( R_1\times R_2)=R_1⋈_\theta R_2$ But I need ... and selection as shown above, does it mean columns of resultant relation will contain ALL columns from both $R_1$ and $R_2$?