3.6k 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 | 3.6k views
+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

$r \subset s$ 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.$

by Boss (13.6k points)
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
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
by Boss (14.4k points)

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

by Active (3.6k points)
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
by Active (3.4k points)
+3
How you are getting a, b ? Your answer is wrong !