**C)**

Consider the following instances of R & S

Let R

$$\begin{array}{|l|l|}\hline \text{A} & \text{B} & \text{C} \\\hline \text{1} & \text{2} &\text{3} \\\hline \text{1} & \text{2} &\text{3} \\\hline \text{7} & \text{8} &\text{9} \\\hline \text{7} & \text{8} &\text{9} \\\hline \end{array}$$

A |
B |
C |

1 |
2 |
3 |

1 |
2 |
3 |

7 |
8 |
9 |

7 |
8 |
9 |

Let S:-

$$\begin{array}{|l|l|}\hline \text{A} & \text{X} & \text{Z} \\\hline \text{1} & \text{2} &\text{3} \\\hline \text{3} & \text{5} &\text{7} \\\hline \text{7} & \text{6} &\text{5} \\\hline \text{7} & \text{6} &\text{5} \\\hline \end{array}$$

A |
X |
Z |

1 |
2 |
3 |

3 |
5 |
7 |

7 |
6 |
5 |

7 |
5 |
4 |

Now output of given Query

select * from R where a in (select S.a from S)

$$\begin{array}{|l|l|}\hline \text{A} & \text{B} & \text{C} \\\hline \text{1} & \text{2} &\text{3} \\\hline \text{1} & \text{2} &\text{3} \\\hline \text{7} & \text{8} &\text{9} \\\hline \text{7} & \text{8} &\text{9} \\\hline \end{array}$$

A |
B |
C |

1 |
2 |
3 |

1 |
2 |
3 |

7 |
8 |
9 |

7 |
8 |
9 |

For Option,

A) since multiplicity of tuples is disturbed

select R.* from R, S where R.a=S.a

∴ Output will be

$$\begin{array}{|l|l|}\hline \text{A} & \text{B} & \text{C} \\\hline \text{1} & \text{2} &\text{3} \\\hline \text{1} & \text{2} &\text{3} \\\hline \text{7} & \text{8} &\text{9} \\\hline \text{7} & \text{8} &\text{9} \\\hline \text{7} & \text{8} &\text{9} \\\hline \text{7} & \text{8} &\text{9} \\\hline \end{array}$$

A |
B |
C |

1 |
2 |
3 |

1 |
2 |
3 |

7 |
8 |
9 |

7 |
8 |
9 |

7 |
8 |
9 |

7 |
8 |
9 |

B)

select distinct R.* from R,S where R.a=S.a

∵only Distinct R will be chosen in the end so , Output will look like

$$\begin{array}{|l|l|}\hline \text{A} & \text{B} & \text{C} \\\hline \text{1} & \text{2} &\text{3}\\\hline \text{7} & \text{8} &\text{9} \\\hline \end{array}$$

C) **ANSWER**

select R.* from R,(select distinct a from S) as S1 where R.a=S1.a

Multiplicity of tuples is maintained. ∵ Multiplicity of duplicate tuples will be distributed when there is a match between R.a and S.a and for that match S.a’s value is repeated.

So, Output will be

$$\begin{array}{|l|l|}\hline \text{A} & \text{B} & \text{C} \\\hline \text{1} & \text{2} &\text{3} \\\hline \text{1} & \text{2} &\text{3} \\\hline \text{7} & \text{8} &\text{9} \\\hline \text{7} & \text{8} &\text{9} \\\hline \end{array}$$

A |
B |
C |

1 |
2 |
3 |

1 |
2 |
3 |

7 |
8 |
9 |

7 |
8 |
9 |