search
Log In
30 votes
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$

in Databases
retagged
5.1k 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

4 Answers

47 votes
 
Best answer

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$

23 votes
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..

check this link for clarification:

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

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
–4 votes
(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 !
Answer:

Related questions

0 votes
1 answer
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$.
asked Sep 20, 2018 in Databases jothee 120 views
0 votes
0 answers
2
276 views
Consider two relations R(A, B, C) and S(B, D) with R contains 5000 tuples stored in a sequential file sorted on attribute A and S contain 100000 tuples stored in a sequential file sorted on attribute B. Each block can hold 10 R tuples or 10 S tuples. Which one of the following index is most appropriate for answering query R (natural Join) S (Assume index always stored in memory)
asked Jul 14, 2018 in Databases Na462 276 views
0 votes
0 answers
3
444 views
Consider relation R' and S' have n' and m' tuples, respectively. Choose the best matching between List-I (Expression) and List-II (Maximum number of tuple): Soln. According to me Answer should be Option C. 1.R union S = m+n (easy nothing to say) 2. Say Relations are like:- R(A,B,C) s(C,D) ... D 1 2 3 3 4 2 3 3 3 5 4 3 3 3 6 Now in R natual join S = m * n So option C should suffice isn't it ?
asked Jun 14, 2018 in Databases Na462 444 views
0 votes
0 answers
4
256 views
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$?
asked May 12, 2018 in Databases GateAspirant999 256 views
...